-
Notifications
You must be signed in to change notification settings - Fork 3
111 lines (87 loc) · 2.91 KB
/
ci.yml
File metadata and controls
111 lines (87 loc) · 2.91 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI
permissions:
contents: read
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/ci*.yml'
- 'Cargo.toml'
- 'Cargo.lock'
- 'benches/**'
- 'crates/**'
- 'tools/setup-db.sh'
- 'tools/docker-compose.test.yaml'
env:
CARGO_TERM_COLOR: always
NEXTEST_RETRIES: 3
jobs:
test:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install protobuf-compiler
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Install Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Install cargo-nextest
uses: taiki-e/install-action@de6bbd1333b8f331563d54a051e542c7dfef81c3 # v2.68.34
with:
tool: cargo-nextest
- name: Rust Cache
uses: swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
- name: Run tests (unit)
run: cargo nextest run
- name: Run tests (sqlite)
run: cargo nextest run --test integration
- name: Run tests (mysql)
run: cargo nextest run --test integration --profile mysql --no-capture
- name: Run tests for postgres
run: cargo nextest run --test integration --profile postgres --no-capture
- name: Run Doc tests
run: cargo test --doc
- name: Dump docker state
if: failure()
run: docker ps -a
openapi:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Install protobuf-compiler
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Rust Cache
uses: swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
- name: Generate OpenAPI
run: cargo run --bin keystone -- --dump-openapi yaml > openapi.yaml
- name: Upload OpenAPI spec
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: openapi.spec
path: openapi.yaml