-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (55 loc) · 1.76 KB
/
Copy pathci.yml
File metadata and controls
61 lines (55 loc) · 1.76 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
55
56
57
58
59
60
61
# Continuous integration: formatting, lints, and tests on every push/PR.
# Tests run on Linux/macOS/Windows so the cross-OS paths (e.g. `key`'s home +
# clipboard resolution) are actually exercised on each platform.
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# Cancel superseded runs on the same ref (newest push wins).
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check
test:
name: clippy + test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --all-features -- -D warnings
# Hermetic suite (incl. tests/cli.rs); tests/net.rs self-skips without the gate.
- run: cargo test --workspace --all-features
# Network-gated integration tests (tests/net.rs): clone a public repo over HTTPS
# (no ssh) and run logoff. Kept off the 3-OS matrix so it stays hermetic/fast;
# runs ubuntu-only with the gate set. Needs no secrets (public repo).
net-tests:
name: net tests (ubuntu, gated)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test -p gkit --test net -- --nocapture
env:
GKIT_NET_TESTS: "1"