-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (43 loc) · 1.19 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [main]
pull_request_target:
branches: [main]
types:
- opened
- synchronize
jobs:
test:
name: Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Check spelling
run: |
if ! which typos > /dev/null; then
cargo install typos-cli
fi
typos
- name: Generate code
run: cargo run -p codegen
- name: Check formatting
run: cargo fmt --check
- name: Check linting
run: cargo clippy
- name: Run tests
env:
GITHUB_PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
GITHUB_APP_ID: ${{ secrets.GH_APP_ID }}
run: |
private_key_path=$(mktemp)
echo "${{ secrets.GH_APP_PRIVATE_KEY }}" | base64 --decode > $private_key_path
export GITHUB_APP_PRIVATE_KEY_PATH=$private_key_path
cargo test --all-features -- --nocapture