-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (46 loc) · 1.38 KB
/
test.yaml
File metadata and controls
54 lines (46 loc) · 1.38 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
name: Run Tests
on:
pull_request:
jobs:
git-diff:
runs-on: ubuntu-latest
name: 'Git Diff - Powered by Rust'
outputs:
DIFF_FILES: ${{ steps.git-diff.outputs.DIFF_FILES }}
DIFF_COUNT: ${{ steps.git-diff.outputs.DIFF_COUNT }}
steps:
- uses: actions/checkout@v4
- uses: LuisLiraC/git-diff@v1.0.3
id: git-diff
with:
patterns: '*.rs'
test:
runs-on: ubuntu-latest
needs: [git-diff]
if: ${{ needs.git-diff.outputs.DIFF_COUNT != 0 }}
name: Run Tests
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Run Tests
run: cargo test --color always