-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (63 loc) · 1.72 KB
/
Copy pathci.yml
File metadata and controls
68 lines (63 loc) · 1.72 KB
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
name: CI
on:
push:
branches:
- main
paths:
- "bot/src/**"
- "builders/src/**"
- "bot/Cargo.toml"
- "builders/Cargo.toml"
- "Cargo.toml"
pull_request:
branches:
- main
paths:
- "bot/src/**"
- "builders/src/**"
- "bot/Cargo.toml"
- "builders/Cargo.toml"
- "Cargo.toml"
concurrency:
# Use github.run_id on main branch
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
# Use github.ref on other branches, so it's unique per branch
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_VERSION_STABLE: stable
RUST_VERSION_NIGHTLY: nightly
jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION_STABLE }}
profile: minimal
override: true
- name: Build
run: cargo build --all-targets
- name: Test
run: cargo test
lint:
runs-on: ubuntu-22.04
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION_NIGHTLY }}
profile: minimal
components: rustfmt, clippy
override: true
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings $(cat .lints | cut -f1 -d"#" | tr '\n' ' ')
- name: Run rustfmt
run: cargo fmt -- --check