-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (57 loc) · 1.51 KB
/
check.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
name: check
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
RUST_TOOLCHAIN: '1.81'
jobs:
test:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: '${{ env.RUST_TOOLCHAIN }}'
# Compile, but don't run.
- run: cargo test --no-run
- run: cargo test --all-features
- name: Test xrcf-bin output
run: |
HELP_OUTPUT=$(cargo run --bin xrcf-bin -- --help)
echo "$HELP_OUTPUT"
if ! echo "$HELP_OUTPUT" | grep -q "Usage: xrcf-bin"; then
echo
echo "Unexpected help output"
exit 1
fi
- name: Test xrcf docs build
run: |
cd xrcf/
# Deny warnings.
RUSTDOCFLAGS="-D warnings" cargo doc
typos:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master
with:
files: '.'
fmt:
runs-on: ubuntu-22.04
timeout-minutes: 10
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: '${{ env.RUST_TOOLCHAIN }}'
# Do not use the default GitHub Action.
# It took both Forgejo and the runner down (100% CPU).
- run: rustup component add rustfmt
- run: cargo fmt --all --check