.github/workflows/ci.yml
77 lines · 1876 bytes
1on:
2 push:
3 branches:
4 - main
5 pull_request:
6 branches:
7 - main
8
9name: CI
10
11jobs:
12 clippy_check:
13 runs-on: ubuntu-latest
14 steps:
15 - name: Checkout code
16 uses: actions/checkout@v3
17 with:
18 submodules: true
19 - name: Install Rust
20 uses: actions-rs/toolchain@v1
21 with:
22 toolchain: stable
23 components: clippy
24 override: true
25 - name: Check Clippy
26 uses: actions-rs/clippy-check@v1
27 with:
28 token: ${{ secrets.GITHUB_TOKEN }}
29 toolchain: stable
30 args:
31 test:
32 strategy:
33 matrix:
34 platform: [ubuntu-latest, windows-latest, macos-latest]
35 runs-on: ${{ matrix.platform }}
36 steps:
37 - name: Checkout code
38 uses: actions/checkout@v3
39 with:
40 submodules: true
41 - name: Install Rust
42 uses: actions-rs/toolchain@v1
43 with:
44 toolchain: nightly
45 override: true
46 components: rustfmt, clippy
47 - name: Cache cargo registry
48 uses: actions/cache@v3
49 with:
50 path: ~/.cargo/registry
51 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
52 - name: Cache cargo build
53 uses: actions/cache@v3
54 with:
55 path: target
56 key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
57 - name: Check formatting
58 uses: actions-rs/cargo@v1
59 with:
60 command: fmt
61 args: --all -- --check
62 - name: Run tests
63 uses: actions-rs/cargo@v1
64 with:
65 command: test
66 - name: Build artifacts
67 uses: actions-rs/cargo@v1
68 with:
69 command: build
70 args: '--release'
71 - name: Upload artifacts
72 uses: actions/upload-artifact@master
73 with:
74 name: iamb-${{ matrix.platform }}
75 path: |
76 ./target/release/iamb
77 ./target/release/iamb.exe