-
Notifications
You must be signed in to change notification settings - Fork 11
55 lines (47 loc) · 1.62 KB
/
ci.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
name: Build
on: [push, pull_request]
jobs:
setup-and-lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Cache Project
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
- name: Install toolchain
uses: ./.github/actions/setup-env
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Lint code with rustfmt and clippy
run: |
cargo +nightly fmt -- --check
cargo clippy -- -D warnings
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
needs: setup-and-lint
env:
SPIFFE_ENDPOINT_SOCKET: unix:/tmp/spire-agent/public/api.sock
SPIRE_ADMIN_ENDPOINT_SOCKET: unix:/tmp/spire-agent/admin/api.sock
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive
- name: Cache Project
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
- name: Install toolchain
uses: ./.github/actions/setup-env
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Rust project
run: cargo build
- name: Start SPIRE
run: .github/workflows/scripts/run-spire.sh &
- name: Run Integration Tests
run: RUST_BACKTRACE=1 cargo test --features integration-tests
- name: Clean up SPIRE
run: .github/workflows/scripts/cleanup-spire.sh