From 806ab5bf91598205907bfad844864a089ebfacd4 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Fri, 12 Aug 2022 16:28:17 +0200 Subject: [PATCH] ci: run miri tests first it seems runners are assigned to jobs in the order they appear in the yaml file. miri takes the longest so it's better if it appears first --- .github/workflows/build.yml | 79 +++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5db72da6..3e79a12a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,46 @@ env: CARGO_TERM_COLOR: always jobs: + # Run MIRI tests on nightly + # NOTE first because it takes the longest to complete + testmiri: + name: testmiri + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Cache cargo dependencies + uses: actions/cache@v2 + with: + path: | + - ~/.cargo/bin/ + - ~/.cargo/registry/index/ + - ~/.cargo/registry/cache/ + - ~/.cargo/git/db/ + key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-cargo- + + - name: Cache build output dependencies + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-build- + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: x86_64-unknown-linux-gnu + components: miri + override: true + + - name: Run miri + run: MIRIFLAGS=-Zmiri-ignore-leaks cargo miri test + # Run cargo fmt --check style: name: style @@ -301,44 +341,6 @@ jobs: run: cargo run - # Run MIRI tests on nightly - testmiri: - name: testmiri - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Cache cargo dependencies - uses: actions/cache@v2 - with: - path: | - - ~/.cargo/bin/ - - ~/.cargo/registry/index/ - - ~/.cargo/registry/cache/ - - ~/.cargo/git/db/ - key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.OS }}-cargo- - - - name: Cache build output dependencies - uses: actions/cache@v2 - with: - path: target - key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.OS }}-build- - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - target: x86_64-unknown-linux-gnu - components: miri - override: true - - - name: Run miri - run: MIRIFLAGS=-Zmiri-ignore-leaks cargo miri test # Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149 # @@ -354,6 +356,7 @@ jobs: - testcpass - testtsan - testcfail + - testmiri runs-on: ubuntu-latest steps: - name: Mark the job as a success