Improve overall speed. #449
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: Continuous Integration | |
on: | |
pull_request: | |
branches: [ master, next ] | |
push: | |
branches: [ master ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
# disable linting for now as it is a mess | |
if: false | |
name: lint | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [ 1.75, stable, nightly ] | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Setup Graphviz | |
uses: ts-graphviz/setup-graphviz@v1 | |
- name: Install SVGO | |
run: npm install -g svgo | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: ${{ matrix.toolchain == 'nightly' && 'rustfmt clippy llvm-tools-preview miri' || 'rustfmt clippy' }} | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install tools | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: just@1.13.0,cargo-hack@0.5.28 | |
# Because we ensure an empty git diff, the job will fail if the SVG is not up-to-date. | |
- name: Generate SVG | |
run: just generate-svg | |
- name: Check formatting | |
run: just format --check | |
- name: Check clippy | |
run: just clippy -- -D warnings | |
- name: Check public documentation | |
env: | |
RUSTDOCFLAGS: "--check -Z unstable-options -D warnings" | |
run: just doc | |
- name: Check private documentation | |
env: | |
RUSTDOCFLAGS: "--check -Z unstable-options -D warnings" | |
run: just doc --document-private-items | |
- name: Ensure empty git diff | |
run: git --no-pager diff --exit-code --color | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [ 1.75, stable, nightly ] | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: ${{ matrix.toolchain == 'nightly' && 'rustfmt clippy llvm-tools-preview miri' || 'rustfmt clippy' }} | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install tools | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: just@1.13.0,cargo-hack@0.5.28,cargo-nextest@0.9.57 | |
- name: Run tests | |
run: just test --no-fail-fast | |
- name: Run miri | |
if: ${{ startsWith(matrix.toolchain, 'nightly') }} | |
run: just miri --no-fail-fast | |
- name: Ensure empty git diff | |
run: git --no-pager diff --exit-code --color | |
coverage: | |
name: coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly | |
components: rustfmt clippy llvm-tools-preview miri | |
- name: Cache Rust dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install tools | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: just@1.13.0,cargo-nextest@0.9.57,cargo-llvm-cov@0.5.19 | |
- name: Run tests | |
run: just coverage --lcov --output-path lcov.info | |
# TODO: use a tool like codecov to upload the coverage report |