Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CI for Heph-inbox #597

Merged
merged 5 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .github/workflows/inbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ on:
- ".github/workflows/inbox.yml"
permissions:
contents: read
defaults:
run:
working-directory: inbox
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
Test:
runs-on: ubuntu-latest
timeout-minutes: 10
if: false # FIXME.
# This often run too many iterations on CI, which is not a real error.
continue-on-error: ${{ matrix.release == 'release' }}
strategy:
Expand All @@ -34,21 +30,18 @@ jobs:
- uses: ./.github/workflows/test
with:
test-flags: ${{ matrix.release }}
working-directory: inbox
Miri:
runs-on: ubuntu-latest
timeout-minutes: 10
if: false # FIXME.
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- uses: ./.github/workflows/test_miri
with:
components: miri
- name: Run tests in Miri
run: cargo miri test
working-directory: inbox
Sanitiser:
runs-on: ubuntu-latest
timeout-minutes: 10
if: false # FIXME.
strategy:
fail-fast: false
matrix:
Expand All @@ -58,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
20 changes: 20 additions & 0 deletions .github/workflows/test_miri/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Test with miri'
description: 'Run tests using `make test_miri`.'
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
shell: bash
run: |
cd "${{ inputs.working-directory }}"
TEST_FLAGS="${{ inputs.test-flags }}" make test_miri
12 changes: 10 additions & 2 deletions .github/workflows/test_sanitizer/action.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
name: 'Test with sanitizer'
description: 'Run tests using `make test`.'
description: 'Run tests using `make test_sanitizer`.'
inputs:
sanitizer:
description: 'Sanitizer to use.'
required: true
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: make test_sanitizer sanitizer="${{ inputs.sanitizer }}"
shell: bash
run: |
cd "${{ inputs.working-directory }}"
TEST_FLAGS="${{ inputs.test-flags }}" make test_sanitizer sanitizer="${{ inputs.sanitizer }}"
4 changes: 4 additions & 0 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ test_sanitizer:
RUSTDOCFLAGS=-Zsanitizer=$(sanitizer) RUSTFLAGS=-Zsanitizer=$(sanitizer) \
cargo test -Zbuild-std --all-features --target x86_64-unknown-linux-gnu $(TEST_FLAGS) $(TEST_OPTS)

# TODO: add TEST_OPTS to this, currently this doesn't work with miri.
test_miri:
cargo miri test --all-features $(TEST_FLAGS)

check:
cargo check --all-features --all-targets

Expand Down