fix #908
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: CI | |
on: [push, workflow_dispatch] | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: -D warnings -C instrument-coverage -C link-dead-code -Z coverage-options=branch | |
RUSTDOCFLAGS: -D warnings -D missing_docs | |
jobs: | |
cargo: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
- name: Set up Rust (nightly) | |
run: | | |
rustup install nightly | |
rustup override set nightly | |
rustup component add --toolchain nightly rustfmt clippy | |
- name: cargo fmt | |
run: cargo fmt --all -- --check | |
- name: cargo clippy | |
run: cargo clippy --all-targets --all-features -- -D warnings | |
- name: cargo build | |
run: cargo build | |
- name: cargo test | |
run: cargo test | |
- name: cargo doc | |
run: cargo doc --all | |
library_checker_aizu_tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
- name: Set up Rust (nightly) | |
run: | | |
rustup install nightly | |
rustup override set nightly | |
rustup component add --toolchain nightly rustfmt clippy | |
cargo install cargo-binutils rustfilt | |
rustup component add llvm-tools-preview | |
- name: install oj-verify submodule | |
run: | | |
git submodule init | |
git submodule update | |
cd verification-helper | |
pip install . | |
cd .. | |
# clear submodule afterwards to not run tests in verification-helper | |
git submodule deinit --all -f | |
- name: run tests | |
# regarding `--jobs 4`: github CI runs with 4 cores | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories | |
# | |
# regarding `--timeout `: github CI limits jobs to 6 hours | |
# https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits | |
# | |
# since the library is a single crate, on a commit the entire crate is | |
# rebuild, so oj-verify tool thinks everything changed, and then reruns all | |
# tests; thus another reason for setting long timeout. | |
# | |
# since all tests are rerun on every commit anyways, there's no need for | |
# the .verify-helper/timestamps.remote.json file | |
run: oj-verify all --tle 20 --jobs 4 --timeout 21600 | |
# https://doc.rust-lang.org/rustc/instrument-coverage.html | |
- name: code coverage | |
run: ./.github/workflows/code_cov.sh | |
shellcheck_shfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: sudo apt install shfmt shellcheck | |
- name: shellcheck and shfmt | |
run: ./.github/workflows/shellcheck_shfmt.sh |