1
1
name : Build
2
+ permissions : {}
2
3
3
4
on :
4
5
push :
13
14
- " diesel.toml"
14
15
- " docker/Dockerfile.j2"
15
16
- " docker/DockerSettings.yaml"
17
+
16
18
pull_request :
17
19
paths :
18
20
- " .github/workflows/build.yml"
28
30
29
31
jobs :
30
32
build :
33
+ name : Build and Test ${{ matrix.channel }}
34
+ permissions :
35
+ actions : write
36
+ contents : read
31
37
# We use Ubuntu 22.04 here because this matches the library versions used within the Debian docker containers
32
38
runs-on : ubuntu-22.04
33
39
timeout-minutes : 120
34
40
# Make warnings errors, this is to prevent warnings slipping through.
35
41
# This is done globally to prevent rebuilds when the RUSTFLAGS env variable changes.
36
42
env :
37
- RUSTFLAGS : " -D warnings "
43
+ RUSTFLAGS : " -Dwarnings "
38
44
strategy :
39
45
fail-fast : false
40
46
matrix :
41
47
channel :
42
48
- " rust-toolchain" # The version defined in rust-toolchain
43
49
- " msrv" # The supported MSRV
44
50
45
- name : Build and Test ${{ matrix.channel }}
46
-
47
51
steps :
48
- # Checkout the repo
49
- - name : " Checkout"
50
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51
- # End Checkout the repo
52
-
53
-
54
52
# Install dependencies
55
53
- name : " Install dependencies Ubuntu"
56
54
run : sudo apt-get update && sudo apt-get install -y --no-install-recommends openssl build-essential libmariadb-dev-compat libpq-dev libssl-dev pkg-config
57
55
# End Install dependencies
58
56
57
+ # Checkout the repo
58
+ - name : " Checkout"
59
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
60
+ with :
61
+ persist-credentials : false
62
+ fetch-depth : 0
63
+ # End Checkout the repo
59
64
60
65
# Determine rust-toolchain version
61
66
- name : Init Variables
75
80
76
81
# Only install the clippy and rustfmt components on the default rust-toolchain
77
82
- name : " Install rust-toolchain version"
78
- uses : dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203 # master @ Dec 14, 2024, 5:49 AM GMT+1
83
+ uses : dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c # master @ Jan 30, 2025, 8:16 PM GMT+1
79
84
if : ${{ matrix.channel == 'rust-toolchain' }}
80
85
with :
81
86
toolchain : " ${{steps.toolchain.outputs.RUST_TOOLCHAIN}}"
@@ -85,19 +90,21 @@ jobs:
85
90
86
91
# Install the any other channel to be used for which we do not execute clippy and rustfmt
87
92
- name : " Install MSRV version"
88
- uses : dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203 # master @ Dec 14, 2024, 5:49 AM GMT+1
93
+ uses : dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c # master @ Jan 30, 2025, 8:16 PM GMT+1
89
94
if : ${{ matrix.channel != 'rust-toolchain' }}
90
95
with :
91
96
toolchain : " ${{steps.toolchain.outputs.RUST_TOOLCHAIN}}"
92
97
# End Install the MSRV channel to be used
93
98
94
99
# Set the current matrix toolchain version as default
95
100
- name : " Set toolchain ${{steps.toolchain.outputs.RUST_TOOLCHAIN}} as default"
101
+ env :
102
+ RUST_TOOLCHAIN : ${{steps.toolchain.outputs.RUST_TOOLCHAIN}}
96
103
run : |
97
104
# Remove the rust-toolchain.toml
98
105
rm rust-toolchain.toml
99
106
# Set the default
100
- rustup default ${{steps.toolchain.outputs. RUST_TOOLCHAIN}}
107
+ rustup default "${ RUST_TOOLCHAIN}"
101
108
102
109
# Show environment
103
110
- name : " Show environment"
@@ -161,7 +168,7 @@ jobs:
161
168
id : clippy
162
169
if : ${{ !cancelled() && matrix.channel == 'rust-toolchain' }}
163
170
run : |
164
- cargo clippy --features sqlite,mysql,postgresql,enable_mimalloc -- -D warnings
171
+ cargo clippy --features sqlite,mysql,postgresql,enable_mimalloc
165
172
# End Run cargo clippy
166
173
167
174
@@ -178,22 +185,31 @@ jobs:
178
185
# This is useful so all test/clippy/fmt actions are done, and they can all be addressed
179
186
- name : " Some checks failed"
180
187
if : ${{ failure() }}
188
+ env :
189
+ TEST_DB_M_L : ${{ steps.test_sqlite_mysql_postgresql_mimalloc_logger.outcome }}
190
+ TEST_DB_M : ${{ steps.test_sqlite_mysql_postgresql_mimalloc.outcome }}
191
+ TEST_DB : ${{ steps.test_sqlite_mysql_postgresql.outcome }}
192
+ TEST_SQLITE : ${{ steps.test_sqlite.outcome }}
193
+ TEST_MYSQL : ${{ steps.test_mysql.outcome }}
194
+ TEST_POSTGRESQL : ${{ steps.test_postgresql.outcome }}
195
+ CLIPPY : ${{ steps.clippy.outcome }}
196
+ FMT : ${{ steps.formatting.outcome }}
181
197
run : |
182
- echo "### :x: Checks Failed!" >> $ GITHUB_STEP_SUMMARY
183
- echo "" >> $ GITHUB_STEP_SUMMARY
184
- echo "|Job|Status|" >> $ GITHUB_STEP_SUMMARY
185
- echo "|---|------|" >> $ GITHUB_STEP_SUMMARY
186
- echo "|test (sqlite,mysql,postgresql,enable_mimalloc,query_logger)|${{ steps.test_sqlite_mysql_postgresql_mimalloc_logger.outcome }} |" >> $ GITHUB_STEP_SUMMARY
187
- echo "|test (sqlite,mysql,postgresql,enable_mimalloc)|${{ steps.test_sqlite_mysql_postgresql_mimalloc.outcome }} |" >> $ GITHUB_STEP_SUMMARY
188
- echo "|test (sqlite,mysql,postgresql)|${{ steps.test_sqlite_mysql_postgresql.outcome }} |" >> $ GITHUB_STEP_SUMMARY
189
- echo "|test (sqlite)|${{ steps.test_sqlite.outcome }} |" >> $ GITHUB_STEP_SUMMARY
190
- echo "|test (mysql)|${{ steps.test_mysql.outcome }} |" >> $ GITHUB_STEP_SUMMARY
191
- echo "|test (postgresql)|${{ steps.test_postgresql.outcome }} |" >> $ GITHUB_STEP_SUMMARY
192
- echo "|clippy (sqlite,mysql,postgresql,enable_mimalloc)|${{ steps.clippy.outcome }} |" >> $ GITHUB_STEP_SUMMARY
193
- echo "|fmt|${{ steps.formatting.outcome }} |" >> $ GITHUB_STEP_SUMMARY
194
- echo "" >> $ GITHUB_STEP_SUMMARY
195
- echo "Please check the failed jobs and fix where needed." >> $ GITHUB_STEP_SUMMARY
196
- echo "" >> $ GITHUB_STEP_SUMMARY
198
+ echo "### :x: Checks Failed!" >> "${ GITHUB_STEP_SUMMARY}"
199
+ echo "" >> "${ GITHUB_STEP_SUMMARY}"
200
+ echo "|Job|Status|" >> "${ GITHUB_STEP_SUMMARY}"
201
+ echo "|---|------|" >> "${ GITHUB_STEP_SUMMARY}"
202
+ echo "|test (sqlite,mysql,postgresql,enable_mimalloc,query_logger)|${TEST_DB_M_L} |" >> "${ GITHUB_STEP_SUMMARY}"
203
+ echo "|test (sqlite,mysql,postgresql,enable_mimalloc)|${TEST_DB_M} |" >> "${ GITHUB_STEP_SUMMARY}"
204
+ echo "|test (sqlite,mysql,postgresql)|${TEST_DB} |" >> "${ GITHUB_STEP_SUMMARY}"
205
+ echo "|test (sqlite)|${TEST_SQLITE} |" >> "${ GITHUB_STEP_SUMMARY}"
206
+ echo "|test (mysql)|${TEST_MYSQL} |" >> "${ GITHUB_STEP_SUMMARY}"
207
+ echo "|test (postgresql)|${TEST_POSTGRESQL} |" >> "${ GITHUB_STEP_SUMMARY}"
208
+ echo "|clippy (sqlite,mysql,postgresql,enable_mimalloc)|${CLIPPY} |" >> "${ GITHUB_STEP_SUMMARY}"
209
+ echo "|fmt|${FMT} |" >> "${ GITHUB_STEP_SUMMARY}"
210
+ echo "" >> "${ GITHUB_STEP_SUMMARY}"
211
+ echo "Please check the failed jobs and fix where needed." >> "${ GITHUB_STEP_SUMMARY}"
212
+ echo "" >> "${ GITHUB_STEP_SUMMARY}"
197
213
exit 1
198
214
199
215
@@ -202,5 +218,5 @@ jobs:
202
218
- name : " All checks passed"
203
219
if : ${{ success() }}
204
220
run : |
205
- echo "### :tada: Checks Passed!" >> $ GITHUB_STEP_SUMMARY
206
- echo "" >> $ GITHUB_STEP_SUMMARY
221
+ echo "### :tada: Checks Passed!" >> "${ GITHUB_STEP_SUMMARY}"
222
+ echo "" >> "${ GITHUB_STEP_SUMMARY}"
0 commit comments