Update repository URL #459
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [staging, trying] | |
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 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- name: cargo fmt --check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
# Compilation check | |
check: | |
name: check | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- i686-unknown-linux-musl | |
- riscv32imc-unknown-none-elf | |
- armv7r-none-eabi | |
- thumbv6m-none-eabi | |
- thumbv7m-none-eabi | |
- thumbv8m.base-none-eabi | |
- thumbv8m.main-none-eabi | |
toolchain: | |
- stable | |
- nightly | |
features: | |
- "" | |
- "cas" | |
- "serde" | |
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-${{ hashFiles('**/Cargo.lock') }} | |
${{ 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-${{ hashFiles('**/Cargo.lock') }} | |
${{ runner.OS }}-build- | |
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }}) | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
target: ${{ matrix.target }} | |
override: true | |
- name: cargo check | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: false | |
command: check | |
args: --target=${{ matrix.target }} --no-default-features --features=${{ matrix.features }} | |
doc: | |
name: doc | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- thumbv7m-none-eabi | |
features: | |
- "" | |
- "cas" | |
- "serde" | |
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-${{ hashFiles('**/Cargo.lock') }} | |
${{ 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-${{ hashFiles('**/Cargo.lock') }} | |
${{ runner.OS }}-build- | |
- name: Install stable Rust with target (${{ matrix.target }}) | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- name: cargo doc | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: false | |
command: doc | |
args: --target=${{ matrix.target }} --no-default-features --features=${{ matrix.features }} | |
# Run cpass tests | |
testcpass: | |
name: testcpass | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- i686-unknown-linux-musl | |
toolchain: | |
- stable | |
- nightly | |
features: | |
- serde | |
buildtype: | |
- "" | |
- "--release" | |
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-${{ hashFiles('**/Cargo.lock') }} | |
${{ 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-${{ hashFiles('**/Cargo.lock') }} | |
${{ runner.OS }}-build- | |
- name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }}) | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
target: ${{ matrix.target }} | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
use-cross: false | |
command: test | |
args: --test cpass --target=${{ matrix.target }} --features=${{ matrix.features }} ${{ matrix.buildtype }} | |
# Run test suite for UI | |
testtsan: | |
name: testtsan | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
toolchain: | |
- nightly | |
buildtype: | |
- "" | |
- "--release" | |
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 ${{ matrix.toolchain }} with target (${{ matrix.target }}) | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
target: ${{ matrix.target }} | |
override: true | |
- name: Export variables | |
run: | | |
echo RUSTFLAGS="-Z sanitizer=thread" >> $GITHUB_ENV | |
echo TSAN_OPTIONS="suppressions=$(pwd)/suppressions.txt" >> $GITHUB_ENV | |
echo $GITHUB_ENV | |
- uses: actions-rs/cargo@v1 | |
with: | |
use-cross: false | |
command: test | |
args: --test tsan --target=${{ matrix.target }} --features=${{ matrix.features }} ${{ matrix.buildtype }} -- --test-threads=1 | |
# Run cfail tests on MSRV | |
testcfail: | |
name: testcfail | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: cfail | |
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: stable | |
target: x86_64-unknown-linux-gnu | |
override: true | |
- name: Run cargo | |
run: cargo run | |
# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149 | |
# | |
# ALL THE PREVIOUS JOBS NEEDS TO BE ADDED TO THE `needs` SECTION OF THIS JOB! | |
ci-success: | |
name: ci | |
if: github.event_name == 'push' && success() | |
needs: | |
- style | |
- check | |
- doc | |
- testcpass | |
- testtsan | |
- testcfail | |
- testmiri | |
runs-on: ubuntu-latest | |
steps: | |
- name: Mark the job as a success | |
run: exit 0 |