From a95b9b051fb7c3b4e7e604a50b61322333284f40 Mon Sep 17 00:00:00 2001 From: strohganoff Date: Thu, 3 Dec 2026 21:22:01 -0700 Subject: [PATCH 1/2] Run labeled pull request tests on stacked branches --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6cda814..47163ed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,7 +6,6 @@ on: paths-ignore: ['*.md', '.gitignore'] pull_request: types: [opened, synchronize, labeled] - branches: [main] jobs: test: runs-on: ubuntu-latest From fed7fee2096b9ff3e5545cd604aedc2c4fa1baad Mon Sep 17 00:00:00 2001 From: strohganoff Date: Thu, 3 Dec 2026 21:37:41 -0700 Subject: [PATCH 2/2] Harden and improve stacked PR test workflows --- .github/workflows/tests.yml | 59 ++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 47163ed..e7dab30 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,24 +1,42 @@ name: Tests -on: +on: push: branches: [main] paths-ignore: ['*.md', '.gitignore'] pull_request: - types: [opened, synchronize, labeled] + types: [opened, synchronize, labeled, reopened, edited] + workflow_dispatch: + +permissions: + contents: read + jobs: test: runs-on: ubuntu-latest + timeout-minutes: 15 + concurrency: + group: tests-${{ github.ref }}-${{ matrix.python-version }} + cancel-in-progress: true strategy: fail-fast: false matrix: python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] - if: github.event_name == 'push' || - ((github.event.action == 'opened' || github.event.action == 'synchronize') && contains(github.event.pull_request.labels.*.name, 'READY TO TEST')) || - (github.event.action == 'labeled' && github.event.label.name == 'READY TO TEST') + if: >- + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'READY TO TEST') && + (github.event.action == 'opened' || + github.event.action == 'synchronize' || + github.event.action == 'reopened' || + (github.event.action == 'labeled' && github.event.label.name == 'READY TO TEST') || + (github.event.action == 'edited' && github.event.changes.base.ref.from != null))) steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: ${{ matrix.python-version }} - name: Install uv @@ -31,7 +49,7 @@ jobs: - name: Test with pytest and python version run: uv run --locked python -m pytest --cov=streamdeck --cov-report=xml --cov-report=html --cov-report=term --junit-xml=reports/xunit-results.xml - name: Upload test coverage reports to artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: test-coverage-reports-${{ matrix.python-version }} path: reports/ @@ -39,12 +57,25 @@ jobs: packaging: name: Build and check distributions runs-on: ubuntu-latest - if: github.event_name == 'push' || - ((github.event.action == 'opened' || github.event.action == 'synchronize') && contains(github.event.pull_request.labels.*.name, 'READY TO TEST')) || - (github.event.action == 'labeled' && github.event.label.name == 'READY TO TEST') + timeout-minutes: 10 + concurrency: + group: packaging-${{ github.ref }} + cancel-in-progress: true + if: >- + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' || + (github.event_name == 'pull_request' && + contains(github.event.pull_request.labels.*.name, 'READY TO TEST') && + (github.event.action == 'opened' || + github.event.action == 'synchronize' || + github.event.action == 'reopened' || + (github.event.action == 'labeled' && github.event.label.name == 'READY TO TEST') || + (github.event.action == 'edited' && github.event.changes.base.ref.from != null))) steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: '3.15' - name: Install uv @@ -67,7 +98,7 @@ jobs: "$RUNNER_TEMP/wheel-smoke/bin/python" -I -m streamdeck --help "$RUNNER_TEMP/wheel-smoke/bin/streamdeck" --help - name: Upload distributions - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: package-distributions path: dist/