fix(ci): run tests according to the right conditions (#4313)
This commit is contained in:
parent
f6692d9154
commit
322f68d81a
|
|
@ -68,18 +68,21 @@ env:
|
||||||
jobs:
|
jobs:
|
||||||
changed-files:
|
changed-files:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Test changed-files
|
name: Checks changed-files
|
||||||
outputs:
|
outputs:
|
||||||
modified_files: ${{ steps.changed-files.outputs.modified_files }}
|
rebuild: ${{ steps.changed-files-rebuild.outputs.any_changed == 'true' }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.0.2
|
- uses: actions/checkout@v3.0.2
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Get changed files
|
- name: Disk rebuild files
|
||||||
id: changed-files
|
id: changed-files-rebuild
|
||||||
uses: tj-actions/changed-files@v19
|
uses: tj-actions/changed-files@v19
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
zebra-state/**/constants.rs
|
||||||
|
|
||||||
build:
|
build:
|
||||||
uses: ./.github/workflows/docker-image-build.yml
|
uses: ./.github/workflows/docker-image-build.yml
|
||||||
|
|
@ -176,7 +179,7 @@ jobs:
|
||||||
needs: [ build, changed-files]
|
needs: [ build, changed-files]
|
||||||
uses: ./.github/workflows/gcp-test-deploy.yml
|
uses: ./.github/workflows/gcp-test-deploy.yml
|
||||||
# Only run this job if the database format version has (likely) changed.
|
# Only run this job if the database format version has (likely) changed.
|
||||||
if: ${{ (contains(needs.changed-files.outputs.modified_files, 'zebra-state/src/constants.rs') && github.event_name == 'push') || github.event.inputs.regenerate-disks == 'true' }}
|
if: ${{ (needs.changed-files.outputs.rebuild == 'true' && github.event_name == 'push') || github.event.inputs.regenerate-disks == 'true' }}
|
||||||
with:
|
with:
|
||||||
test_id: sync-to-checkpoint
|
test_id: sync-to-checkpoint
|
||||||
test_description: Test sync up to mandatory checkpoint
|
test_description: Test sync up to mandatory checkpoint
|
||||||
|
|
@ -206,7 +209,7 @@ jobs:
|
||||||
# TODO change `github.ref_name == 'main'` to `startsWith(github.head_ref, 'mergify/merge-queue/')`
|
# TODO change `github.ref_name == 'main'` to `startsWith(github.head_ref, 'mergify/merge-queue/')`
|
||||||
# to only run on Mergify head branches, and on manual dispatch:
|
# to only run on Mergify head branches, and on manual dispatch:
|
||||||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-based-on-the-head-or-base-branch-of-a-pull-request-1
|
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-based-on-the-head-or-base-branch-of-a-pull-request-1
|
||||||
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || github.event.inputs.run-full-sync == 'true' }}
|
if: ${{ github.event_name == 'push' || github.event.inputs.run-full-sync == 'true' || github.event.inputs.regenerate-disks != 'true'}}
|
||||||
with:
|
with:
|
||||||
test_id: full-sync-to-tip
|
test_id: full-sync-to-tip
|
||||||
test_description: Test a full sync up to the tip
|
test_description: Test a full sync up to the tip
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue