-
Notifications
You must be signed in to change notification settings - Fork 42
144 lines (126 loc) · 4.06 KB
/
ci.yaml
File metadata and controls
144 lines (126 loc) · 4.06 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: ci
on:
push:
branches:
- main
- release/**
merge_group:
types:
- checks_requested
pull_request:
branches:
- main
- release/**
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Check
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2025
- ubuntu-24.04
- macos-15
include:
- os: windows-2025
install: |
git config --system core.longpaths true
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
vcpkg install openssl:x64-windows-static-md
steps:
- uses: actions/checkout@v5
- uses: Swatinem/rust-cache@v2
- name: Cache Theseus Postgresql Installation
uses: actions/cache@v4
with:
path: ~/.theseus/postgresql
key: ${{ runner.os }}-theseus-postgresql-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
if: matrix.install != ''
run: ${{ matrix.install }}
- name: Check
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # for embedded postgresql
run: cargo check
- name: Clippy
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # for embedded postgresql
run: cargo clippy --all-targets --all-features -- -D warnings -D clippy::unwrap_used -D clippy::expect_used
ci:
needs:
- check
runs-on: ubuntu-24.04
steps:
- run: df -h
- name: Maximize build space
run: |
env | sort
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/az
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /opt/hostedtoolcache/go
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/lib/jvm
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /usr/local/julia*
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /opt/microsoft /opt/google
sudo docker image prune --all --force
sudo rm -Rf ${JAVA_HOME_8_X64}
sudo rm -Rf ${JAVA_HOME_11_X64}
sudo rm -Rf ${JAVA_HOME_17_X64}
sudo rm -Rf ${JAVA_HOME_21_X64}
sudo rm -Rf ${JAVA_HOME_25_X64}
sudo rm -Rf ${RUBY_PATH}
sudo rm -Rf ${SWIFT_PATH}
sudo rm -Rf ${GRADLE_HOME}
- run: df -h
- uses: actions/checkout@v5
- uses: Swatinem/rust-cache@v2
- name: Cache Theseus Postgresql Installation
uses: actions/cache@v4
with:
path: ~/.theseus/postgresql
key: ${{ runner.os }}-theseus-postgresql-${{ hashFiles('**/Cargo.lock') }}
- name: Format
run: cargo fmt --check
- name: Start minio
run: |
docker compose -f etc/deploy/compose/compose-minio.yaml up -d --wait
- name: Create tmp dir
run: |
sudo mkdir /mnt/trustify
sudo chmod a+rwx /mnt/trustify
- name: Test
run: cargo test --all-features
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # for embedded postgresql
RUST_LOG: info,sqlx=error,sea_orm=error
TRUSTIFY_S3_AWS_REGION: eu-west-1
TRUSTIFY_S3_AWS_BUCKET: guacsec-migration-dumps
TMPDIR: /mnt/trustify
- name: Export and Validate Generated Openapi Spec
run: |
cargo xtask openapi
if ! git diff --quiet; then
echo "::error::Uncommitted changes (run 'cargo xtask openapi' after making api changes)"
exit 1
fi
- name: Ensure schemas are up-to-date
run: |
cargo xtask generate-schemas
if ! git diff --quiet; then
echo "::error::Uncommitted changes (run 'cargo xtask generate-schemas' after making changes to the models)"
exit 1
fi
- name: Check the docs
run: |
cd docs/book
npm ci
make all