Repository navigation
71 lines (56 loc) · 1.8 KB
/
Copy pathci.yml
File metadata and controls
71 lines (56 loc) · 1.8 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
69
70
71
name: Cargo Build & Test
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
workflow_call:
# cancel previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
SKIP_WASM_BUILD: 1
jobs:
ci:
name: CI
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch cache
uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
with:
shared-key: "wrapper-cache"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: deps
shell: bash
run: |
sudo apt-get install protobuf-compiler
- name: Init nigthly install for fmt
run: rustup update nightly && rustup default nightly && rustup component add rustfmt
- name: Check format
run: cargo +nightly fmt --check --all
- name: Install Clippy
run: rustup component add clippy
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Build
run: cargo build
- name: Tests
run: cargo test
- name: Check docs
run: cargo doc --no-deps -p zombie-bite-core
env:
RUSTDOCFLAGS: "-Dwarnings"
# Own target dir: the verify step builds zombie-bite against a registry
# copy of zombie-bite-core, which cargo never rebuilds for the same
# version, so a cached build would hide api changes.
- name: Check crates can be published
run: cargo publish --workspace --dry-run --target-dir ${{ runner.temp }}/publish-check