diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ffb6d56..84b9d25c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,17 +24,30 @@ jobs: # Check if changes were made to the relevant files. # Always returns true if running on the default branch, to ensure all changes are throughly checked. changes: - name: Check for changes in Rust files + name: Check for changes runs-on: ubuntu-latest # Required permissions permissions: pull-requests: read # Set job outputs to values from filter step + # These outputs are always true when running after a merge to main, or if the PR has a `run-ci-checks` label. outputs: - rust: ${{ github.ref_name == github.event.repository.default_branch || steps.filter.outputs.rust }} - python: ${{ github.ref_name == github.event.repository.default_branch || steps.filter.outputs.python }} + rust: ${{ steps.filter.outputs.rust == 'true' || steps.override.outputs.out == 'true' }} + python: ${{ steps.filter.outputs.python == 'true' || steps.override.outputs.out == 'true' }} steps: - uses: actions/checkout@v4 + - name: Override label + id: override + run: | + echo "Labels: ${{ github.event.pull_request.labels.*.name }}" + echo "Label contains run-ci-checks: ${{ contains( github.event.pull_request.labels.*.name, 'run-ci-checks') }}" + if [ "${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-ci-checks') }}" == "true" ]; then + echo "Overriding due to label 'run-ci-checks'" + echo "out=true" >> $GITHUB_OUTPUT + elif [ "${{ github.ref_name == github.event.repository.default_branch }}" == "true" ]; then + echo "Overriding due to running on the default branch" + echo "out=true" >> $GITHUB_OUTPUT + fi - uses: dorny/paths-filter@v3 id: filter with: @@ -264,6 +277,10 @@ jobs: if: ${{ !cancelled() }} runs-on: ubuntu-latest steps: + - name: Debug changes step output + run: | + echo "Rust: ${{ needs.changes.outputs.rust }}" + echo "Python: ${{ needs.changes.outputs.python }}" - name: Fail if required checks failed # This condition should simply be `if: failure() || cancelled()`, # but there seems to be a bug in the github workflow runner. diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 0ab1acbf..88ad87b2 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -111,6 +111,9 @@ We welcome contributions to tket2! Please open [an issue](https://github.com/CQC PRs should be made against the `main` branch, and should pass all CI checks before being merged. This includes using the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) format for the PR title. +Some tests may be skipped based on the changes made. To run all the tests in +your PR mark it with a 'run-ci-checks' label and push new commits to it. + The general format of a contribution title should be: ```