-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (46 loc) · 1.47 KB
/
test.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
55
name: test
on:
pull_request:
branches: [dev]
types: [opened, synchronize]
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract version
id: extract-version
run: echo "VERSION=$(grep -oP '^version = "\K[^"]+' Cargo.toml | awk '{$1=$1;print}')" >> $GITHUB_OUTPUT
- name: Cache restore
uses: actions/cache/restore@v4
id: cache-cargo-restore
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ steps.extract-version.outputs.VERSION }}
- name: install cargo components
if: steps.cache-cargo-restore.outputs.cache-hit != 'true'
run: rustup component add clippy
- name: Run build
if: steps.cache-cargo-restore.outputs.cache-hit != 'true'
run: cargo build --all-features --all-targets
- name: Cache save
if: steps.cache-cargo-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
id: cache-cargo-save
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ steps.cache-cargo-restore.outputs.cache-primary-key }}
- name: run tests
run: .github/scripts/test.sh