| 1 |
name: test |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- main |
| 6 |
pull_request: |
| 7 |
branches: |
| 8 |
- main |
| 9 |
schedule: |
| 10 |
- cron: "0 8 * * 1" |
| 11 |
workflow_dispatch: |
| 12 |
|
| 13 |
concurrency: |
| 14 |
group: test-${{ github.ref }} |
| 15 |
cancel-in-progress: true |
| 16 |
|
| 17 |
permissions: {} |
| 18 |
|
| 19 |
jobs: |
| 20 |
change-detection: |
| 21 |
uses: ./.github/workflows/reusable-change-detection.yml |
| 22 |
|
| 23 |
check-docs: |
| 24 |
needs: change-detection |
| 25 |
if: fromJSON(needs.change-detection.outputs.run-docs) |
| 26 |
uses: ./.github/workflows/reusable-docs.yml |
| 27 |
|
| 28 |
pytest: |
| 29 |
needs: change-detection |
| 30 |
if: fromJSON(needs.change-detection.outputs.run-tests) |
| 31 |
uses: ./.github/workflows/reusable-pytest.yml |
| 32 |
|
| 33 |
type: |
| 34 |
needs: change-detection |
| 35 |
if: fromJSON(needs.change-detection.outputs.run-tests) |
| 36 |
uses: ./.github/workflows/reusable-type.yml |
| 37 |
|
| 38 |
# https://github.com/marketplace/actions/alls-green#why |
| 39 |
required-checks-pass: # This job does nothing and is only used for the branch protection |
| 40 |
name: Required checks pass |
| 41 |
if: always() |
| 42 |
|
| 43 |
needs: |
| 44 |
- change-detection # transitive |
| 45 |
- check-docs |
| 46 |
- pytest |
| 47 |
- type |
| 48 |
|
| 49 |
runs-on: ubuntu-latest |
| 50 |
|
| 51 |
steps: |
| 52 |
- name: Decide whether the needed jobs succeeded or failed |
| 53 |
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 |
| 54 |
with: |
| 55 |
allowed-skips: >- |
| 56 |
${{ |
| 57 |
!fromJSON(needs.change-detection.outputs.run-docs) |
| 58 |
&& ' |
| 59 |
check-docs, |
| 60 |
' |
| 61 |
|| '' |
| 62 |
}} |
| 63 |
${{ |
| 64 |
!fromJSON(needs.change-detection.outputs.run-tests) |
| 65 |
&& ' |
| 66 |
pytest, |
| 67 |
type, |
| 68 |
' |
| 69 |
|| '' |
| 70 |
}} |
| 71 |
jobs: ${{ toJSON(needs) }} |