|
| 1 | +name: "PR Quality Gate: rc & main" |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [ rc, main ] |
| 6 | + types: [ opened, synchronize, reopened, ready_for_review ] |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + pull-requests: write |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: pr-${{ github.event.pull_request.number || github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + precommit: |
| 18 | + name: pre-commit |
| 19 | + if: ${{ !github.event.pull_request.draft }} |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v4 |
| 23 | + # NOTE: point "uses:" to the DIRECTORY that contains action.yaml |
| 24 | + # If your composite is at ./pre-commit/action.yaml, use "./pre-commit" |
| 25 | + - name: Run pre-commit composite |
| 26 | + uses: ./.github/workflows/pre-commit |
| 27 | + with: |
| 28 | + python-version: ${{ env.MAIN_PYTHON_VERSION }} |
| 29 | + |
| 30 | + pytest: |
| 31 | + name: pytest |
| 32 | + if: ${{ !github.event.pull_request.draft }} |
| 33 | + runs-on: ubuntu-latest |
| 34 | + strategy: |
| 35 | + matrix: |
| 36 | + python-version: ${{ fromJSON(env.SUPPORTED_PYTHON_VERSIONS) }} |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - name: Run pytest composite |
| 40 | + uses: ./.github/workflows/pytest |
| 41 | + with: |
| 42 | + python-version: ${{ matrix.python-version }} |
| 43 | + |
| 44 | + pytest-windows: |
| 45 | + name: pytest (Windows, non-blocking) |
| 46 | + if: ${{ !github.event.pull_request.draft }} |
| 47 | + runs-on: windows-latest |
| 48 | + continue-on-error: true |
| 49 | + strategy: |
| 50 | + matrix: |
| 51 | + python-version: ${{ fromJSON(env.SUPPORTED_PYTHON_VERSIONS) }} |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | + - name: Run pytest composite |
| 55 | + uses: ./.github/workflows/pytest |
| 56 | + with: |
| 57 | + python-version: ${{ matrix.python-version }} |
| 58 | + |
| 59 | + sonarqube: |
| 60 | + name: SonarQube |
| 61 | + if: ${{ !github.event.pull_request.draft }} |
| 62 | + runs-on: ubuntu-latest |
| 63 | + needs: [ pytest ] # starts only after pytest completes |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v4 |
| 66 | + - name: Run SonarCloud composite |
| 67 | + uses: ./.github/workflows/sonar |
| 68 | + with: |
| 69 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
0 commit comments