-
Notifications
You must be signed in to change notification settings - Fork 27
173 lines (142 loc) · 4.72 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: CI
on:
schedule:
- cron: '0 0 * * 6'
push:
branches:
- '*'
pull_request:
jobs:
rustfmt:
strategy:
fail-fast: false
matrix:
toolchain:
- 1.70.0-x86_64-unknown-linux-gnu
- stable-x86_64-unknown-linux-gnu
name: Rustfmt (${{ matrix.toolchain }})
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 'Setup `${{ matrix.toolchain }}`'
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt
- name: 'Override `${{ matrix.toolchain }}'
run: |
rustup override set ${{ matrix.toolchain }}
- name: cargo-fmt
run: |
cargo fmt --all -- --check
build:
strategy:
fail-fast: false
matrix:
toolchain:
- 1.70.0-x86_64-pc-windows-msvc
- 1.70.0-x86_64-apple-darwin
- 1.70.0-x86_64-unknown-linux-gnu
- stable-x86_64-pc-windows-msvc
- stable-x86_64-apple-darwin
- stable-x86_64-unknown-linux-gnu
include:
- { toolchain: 1.70.0-x86_64-pc-windows-msvc , os: windows-2019 }
- { toolchain: 1.70.0-x86_64-apple-darwin , os: macos-11 }
- { toolchain: 1.70.0-x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
- { toolchain: stable-x86_64-pc-windows-msvc , os: windows-2019 }
- { toolchain: stable-x86_64-apple-darwin , os: macos-11 }
- { toolchain: stable-x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
name: Build (${{ matrix.toolchain }})
runs-on: ${{ matrix.os }}
steps:
- name: Disable `core.autocrlf`
run: git config --global core.autocrlf false
if: matrix.os == 'windows-2019'
- name: Checkout
uses: actions/checkout@v3
- name: 'Setup `${{ matrix.toolchain }}`'
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: 'Override `${{ matrix.toolchain }}`'
run: |
rustup override set ${{ matrix.toolchain }}
- name: cargo-clippy
run: |
cargo clippy --workspace --all-targets -- -A renamed-and-removed-lints -D warnings
- name: cargo-build
run: |
cargo build --workspace --all-targets
- name: cargo-test
run: |
cargo test --workspace --no-fail-fast
env:
RUST_BACKTRACE: full
expander_test:
strategy:
fail-fast: false
matrix:
toolchain:
- 1.70.0-x86_64-unknown-linux-gnu
- stable-x86_64-unknown-linux-gnu
python-version:
- '3.6' # https://packages.ubuntu.com/bionic/python3
- '3.8' # https://packages.ubuntu.com/focal/python3
name: Expand_test (${{ matrix.toolchain }}, ${{ matrix.python-version }})
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 'Setup `${{ matrix.toolchain }}`'
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt
- name: 'Override `${{ matrix.toolchain }}`'
run: |
rustup override set ${{ matrix.toolchain }}
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: expand.py tests
run: bash ./.github/workflows/test-expand.sh
verify:
name: Verify
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup `1.70.0-x86_64-unknown-linux-gnu`
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.70.0-x86_64-unknown-linux-gnu
- name: 'Override `1.70.0-x86_64-unknown-linux-gnu'
run: |
rustup override set 1.70.0-x86_64-unknown-linux-gnu
- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install `oj`
run: pip install online-judge-tools
- name: cargo-build
run: |
cargo build --release --examples
- name: Verify
run: |
NAMES=(
convolution_mod
static_range_sum
sum_of_floor_of_linear
unionfind
)
for name in "${NAMES[@]}"; do
oj d "https://judge.yosupo.jp/problem/$name" -ad "/tmp/$name"
done
for name in "${NAMES[@]}"; do
oj t -d "/tmp/$name" -t 10 -c "./target/release/examples/library-checker-${name//_/-}" --judge-command ~/.cache/online-judge-tools/library-checker-problems/*/"$name"/checker
done