Skip to content

Continuous Integration #139

Continuous Integration

Continuous Integration #139

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * 0"
jobs:
check:
name: Check
runs-on: ubuntu-22.04
steps:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Checkout
uses: actions/checkout@v2
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --locked --verbose
test:
name: Test suite
runs-on: ubuntu-22.04
steps:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Checkout
if: github.event_name != 'pull_request'
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Checkout
if: github.event_name == 'pull_request'
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Run tests
run: |
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort"
export RUSTDOCFLAGS="-Cpanic=abort"
curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
cargo build
cargo test --verbose $CARGO_OPTIONS
zip -0 ccov.zip `find . \( -name "qrscan*.gc*" \) -print`;
./grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" -o lcov.info;
bash <(curl -s https://codecov.io/bash) -f lcov.info;
clippy:
name: Lints
runs-on: ubuntu-22.04
steps:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: clippy
override: true
- name: Checkout
uses: actions/checkout@v2
- name: Check the lints
uses: actions-rs/cargo@v1
with:
command: clippy
args: --verbose -- -D warnings
rustfmt:
name: Formatting
runs-on: ubuntu-22.04
steps:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
override: true
- name: Checkout
uses: actions/checkout@v2
- name: Check the formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check --verbose
audit:
name: Audit check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run cargo-audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}