Skip to content

Commit

Permalink
CI: Checkout the correct commit and allow manually running the workflow
Browse files Browse the repository at this point in the history
When the workflows were separated, the workflows that were started from other workflows all checked out the code of the main branch. The behavior was changed so that they checkout the same commit
  • Loading branch information
rhckrtu authored and pentamassiv committed Sep 6, 2024
1 parent 20534bc commit 26f871d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/failing_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
additional_tests:
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Only run if the integration tests succeeded
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} # Only run if the build succeeded
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -60,6 +60,9 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
# If manually triggered, use the current commit (GITHUB_SHA), otherwise use the head_sha from the Build workflow
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- uses: ./.github/actions/install_deps
- uses: dtolnay/rust-toolchain@master
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
integration:
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Only run if the build succeeded
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} # Only run if the build succeeded
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -58,6 +58,9 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
# If manually triggered, use the current commit (GITHUB_SHA), otherwise use the head_sha from the Build workflow
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- uses: ./.github/actions/install_deps
- uses: dtolnay/rust-toolchain@master
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
test:
if: ${{ github.event.workflow_run.conclusion == 'success' }} # Only run if the build succeeded
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} # Only run if the build succeeded
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -60,6 +60,9 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
with:
# If manually triggered, use the current commit (GITHUB_SHA), otherwise use the head_sha from the Build workflow
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- uses: ./.github/actions/install_deps
- uses: dtolnay/rust-toolchain@master
with:
Expand Down

0 comments on commit 26f871d

Please sign in to comment.