From 11a9b7d2b1b3a3227938171ea4fd0078d3352313 Mon Sep 17 00:00:00 2001 From: rhliang Date: Wed, 6 May 2026 14:28:20 -0700 Subject: [PATCH 1/4] Fixed a couple of linting errors. --- tests/acceptable_memory_usage_test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/acceptable_memory_usage_test.py b/tests/acceptable_memory_usage_test.py index 0f4a693..14dacca 100644 --- a/tests/acceptable_memory_usage_test.py +++ b/tests/acceptable_memory_usage_test.py @@ -17,9 +17,11 @@ def test_acceptable_memory_usage(): allele_2: HLAStandard = hla_alg.hla_standards["B"]["B*45:01:01G"] expensive_sequence = HLASequence( - two=(int(s) for s in np.array(allele_1.two) | np.array(allele_2.two)), + two=tuple(int(s) for s in np.array(allele_1.two) | np.array(allele_2.two)), intron=(), - three=(int(s) for s in np.array(allele_1.three) | np.array(allele_2.three)), + three=tuple( + int(s) for s in np.array(allele_1.three) | np.array(allele_2.three) + ), name="expensive_sequence", locus="B", ) From 329d6422a1e79950829e395cc6a67fe04f04408e Mon Sep 17 00:00:00 2001 From: rhliang Date: Wed, 6 May 2026 14:38:27 -0700 Subject: [PATCH 2/4] Trying to clear up some of the warnings in CI about Node.js 20 actions being deprecated. --- .github/workflows/test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4cb7a56..2ef8b29 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,10 +25,10 @@ jobs: python-version: ["3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -48,7 +48,7 @@ jobs: run: uv run pytest --junitxml=pytest.xml - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v6 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -60,6 +60,7 @@ jobs: - name: Upload test results to Codecov if: ${{ !cancelled() }} - uses: codecov/test-results-action@v1 + uses: codecov/codecov-action@v6 with: token: ${{ secrets.CODECOV_TOKEN }} + report_type: test_results From 6f172dce2dff819fcf5b3955b22a33e22f34104e Mon Sep 17 00:00:00 2001 From: Richard Liang Date: Thu, 7 May 2026 15:02:01 -0700 Subject: [PATCH 3/4] Fixed a couple other potential linting errors, and refactored the test to be a little easier to read. --- .github/workflows/acceptable_memory_usage_test.yml | 4 ++-- .github/workflows/build_and_publish_gem.yml | 2 +- tests/acceptable_memory_usage_test.py | 11 +++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/acceptable_memory_usage_test.yml b/.github/workflows/acceptable_memory_usage_test.yml index f33f84e..2aecd55 100644 --- a/.github/workflows/acceptable_memory_usage_test.yml +++ b/.github/workflows/acceptable_memory_usage_test.yml @@ -25,10 +25,10 @@ jobs: python-version: ["3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/build_and_publish_gem.yml b/.github/workflows/build_and_publish_gem.yml index b788e58..a4aad0c 100644 --- a/.github/workflows/build_and_publish_gem.yml +++ b/.github/workflows/build_and_publish_gem.yml @@ -20,7 +20,7 @@ jobs: sudo apt install -y ruby - name: Checkout code from repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Build the Ruby package run: | diff --git a/tests/acceptable_memory_usage_test.py b/tests/acceptable_memory_usage_test.py index 14dacca..33d0725 100644 --- a/tests/acceptable_memory_usage_test.py +++ b/tests/acceptable_memory_usage_test.py @@ -16,12 +16,15 @@ def test_acceptable_memory_usage(): allele_1: HLAStandard = hla_alg.hla_standards["B"]["B*07:02:01G"] allele_2: HLAStandard = hla_alg.hla_standards["B"]["B*45:01:01G"] + # "Mush" together the two sequences by doing a bitwise or of the binary + # sequences. + exon2_bin: np.ndarray = np.array(allele_1.two) | np.array(allele_2.two) + exon3_bin: np.ndarray = np.array(allele_1.three) | np.array(allele_2.three) + expensive_sequence = HLASequence( - two=tuple(int(s) for s in np.array(allele_1.two) | np.array(allele_2.two)), + two=tuple(int(s) for s in exon2_bin), intron=(), - three=tuple( - int(s) for s in np.array(allele_1.three) | np.array(allele_2.three) - ), + three=tuple(int(s) for s in exon3_bin), name="expensive_sequence", locus="B", ) From 8008d49218571df10f2c1254f0c5a5c3346f0ca5 Mon Sep 17 00:00:00 2001 From: Richard Liang Date: Thu, 7 May 2026 15:48:38 -0700 Subject: [PATCH 4/4] An attempt to restrict the slow tests to only running when there's new code that day. We won't know whether this works until tomorrow. --- .../acceptable_memory_usage_test.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/acceptable_memory_usage_test.yml b/.github/workflows/acceptable_memory_usage_test.yml index 2aecd55..e7cf1d5 100644 --- a/.github/workflows/acceptable_memory_usage_test.yml +++ b/.github/workflows/acceptable_memory_usage_test.yml @@ -15,9 +15,28 @@ env: FORCE_COLOR: "1" jobs: + # This logic is based on the discussion here (and the links within): + # https://github.com/orgs/community/discussions/27128 + # + check_for_new_commits: + name: Check for commits in the last 24 hours + runs-on: ubuntu-latest + outputs: + num_new_commits: ${{ steps.count_new_commits.outputs.num_new_commits }} + steps: + - uses: actions/checkout@v6 + + - id: count_new_commits + run: echo "num_new_commits=$(git log --oneline --since '24 hours ago' | wc -l)" >> "$GITHUB_OUTPUT" + + run: name: Python ${{ matrix.python-version }} Performance Tests runs-on: ${{ matrix.os }} + + needs: check_for_new_commits + if: ${{ github.event_name == 'workflow_dispatch' || needs.check_for_new_commits.outputs.num_new_commits > 0 }} + strategy: fail-fast: false matrix: