Skip to content

Commit

Permalink
Add working-directory input to all workflows
Browse files Browse the repository at this point in the history
Apparently the global working-directory doesn't apply to the actions, so
now we have to add a working-directory input to all the workflows and
use it everywhere.

At this point it was not worth it start using the template-like setup...
  • Loading branch information
Thomasdezeeuw committed Aug 11, 2023
1 parent 9c6fb21 commit c49f1f1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/inbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
- ".github/workflows/inbox.yml"
permissions:
contents: read
defaults:
run:
working-directory: inbox
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
Expand All @@ -33,12 +30,15 @@ jobs:
- uses: ./.github/workflows/test
with:
test-flags: ${{ matrix.release }}
working-directory: inbox
Miri:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/test_miri
with:
working-directory: inbox
Sanitiser:
runs-on: ubuntu-latest
timeout-minutes: 10
Expand All @@ -51,3 +51,4 @@ jobs:
- uses: ./.github/workflows/test_sanitizer
with:
sanitizer: ${{ matrix.sanitiser }}
working-directory: inbox
7 changes: 6 additions & 1 deletion .github/workflows/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ inputs:
test-flags:
description: 'Additional flags to pass using TEST_FLAGS (see Makefile).'
required: false
working-directory:
description: 'Working directory.'
required: true
runs:
using: 'composite'
steps:
- uses: dtolnay/rust-toolchain@nightly
- name: Run tests
run: TEST_FLAGS="${{ inputs.test-flags }}" make test
shell: bash
run: |
cd "${{ inputs.working-directory }}"
TEST_FLAGS="${{ inputs.test-flags }}" make test
7 changes: 6 additions & 1 deletion .github/workflows/test_miri/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ inputs:
test-flags:
description: 'Additional flags to pass using TEST_FLAGS (see Makefile).'
required: false
working-directory:
description: 'Working directory.'
required: true
runs:
using: 'composite'
steps:
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- name: Run tests
run: TEST_FLAGS="${{ inputs.test-flags }}" make test_miri
shell: bash
run: |
cd "${{ inputs.working-directory }}"
TEST_FLAGS="${{ inputs.test-flags }}" make test_miri
7 changes: 6 additions & 1 deletion .github/workflows/test_sanitizer/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ inputs:
test-flags:
description: 'Additional flags to pass using TEST_FLAGS (see Makefile).'
required: false
working-directory:
description: 'Working directory.'
required: true
runs:
using: 'composite'
steps:
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- name: Run tests with sanitiser
run: TEST_FLAGS="${{ inputs.test-flags }}" make test_sanitizer sanitizer="${{ inputs.sanitizer }}"
shell: bash
run: |
cd "${{ inputs.working-directory }}"
TEST_FLAGS="${{ inputs.test-flags }}" make test_sanitizer sanitizer="${{ inputs.sanitizer }}"

0 comments on commit c49f1f1

Please sign in to comment.