-
Notifications
You must be signed in to change notification settings - Fork 9
57 lines (53 loc) · 1.54 KB
/
test.yml
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
name: Test
# Run on both PRs and pushes to the main branch.
# It may seem redundant to run tests on main, since we disallow pushing directly
# to main and all PRs get tested before merging.
#
# But due to how GitHub Actions isolates caches, we need to run the tests on
# main so that caches are available to new PRs. The caches created when testing
# PR code cannot be re-used outside of testing that PR.
#
# See the GitHub Actions documentation here:
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
on:
push:
branches: [main]
paths:
- "gitoid/**"
- "omnibor/**"
- "omnibor-cli/**"
- "xtask/**"
pull_request:
branches: [main]
paths:
- "gitoid/**"
- "omnibor/**"
- "omnibor-cli/**"
- "xtask/**"
permissions:
contents: read
env:
RUSTFLAGS: -Dwarnings
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
name: "${{ matrix.os }}"
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}
- name: Dependency Tree
run: cargo tree
- name: Check
run: cargo check --verbose --workspace
- name: Test
run: cargo test --verbose --workspace
- name: Lint
run: cargo clippy --verbose --workspace