Careful Integration #12
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: Careful Integration | |
on: | |
schedule: | |
- cron: "0 0 * * 5" | |
workflow_dispatch: | |
jobs: | |
careful: | |
name: Careful Test | |
runs-on: ${{ matrix.job.os }} | |
strategy: | |
matrix: | |
rust: [nightly] # runs on nightly only | |
job: | |
- os: macos-latest | |
- os: ubuntu-latest | |
- os: windows-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
if: github.event_name != 'pull_request' | |
with: | |
fetch-depth: 0 | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
if: github.event_name == 'pull_request' | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
- name: install cargo-careful | |
uses: taiki-e/install-action@d211c4be5a95cbcd52a0870dda7d63a107a58368 # v2 | |
with: | |
tool: cargo-careful | |
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2 | |
- name: Run Cargo Careful | |
run: cargo +${{ matrix.rust }} careful test | |
miri: | |
name: Miri Test | |
runs-on: ${{ matrix.job.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: [nightly] # runs on nightly only | |
job: | |
- os: macos-latest | |
- os: ubuntu-latest | |
- os: windows-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
if: github.event_name != 'pull_request' | |
with: | |
fetch-depth: 0 | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
if: github.event_name == 'pull_request' | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # v1 | |
with: | |
toolchain: ${{ matrix.rust }} | |
components: miri | |
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2 | |
- name: Run Cargo Clean | |
run: cargo +${{ matrix.rust }} clean # miri needs clean builds | |
- name: Patch Cargo.toml | |
shell: bash | |
run: | | |
# Account for sha256_compress not being interpreted by miri | |
# https://github.com/rust-lang/miri/issues/3066 | |
sed -i -e 's/^sha2 = { version.*/sha2 = "0"/g' ./Cargo.toml | |
- name: Run Cargo Miri Setup | |
run: cargo +${{ matrix.rust }} miri setup # keep output clean | |
- name: Run Cargo Miri | |
env: | |
MIRIFLAGS: -Zmiri-disable-isolation | |
run: cargo +${{ matrix.rust }} miri test -- --nocapture | |
result: | |
name: Result (Careful CI) | |
runs-on: ubuntu-latest | |
needs: | |
- careful | |
- miri | |
steps: | |
- name: Mark the job as successful | |
run: exit 0 | |
if: success() | |
- name: Mark the job as unsuccessful | |
run: exit 1 | |
if: "!success()" |