-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (73 loc) · 2.71 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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