41
41
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
42
42
- name : Install libsasl2-dev
43
43
run : apt-get update && apt-get install -y libsasl2-dev
44
+ - name : Install protobuf compiler
45
+ run : apt-get update && apt-get install protobuf-compiler -y
44
46
- name : Cache dependencies
45
47
uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
46
48
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
52
54
- name : Run sccache-cache
53
55
uses : mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
54
56
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
55
- - name : Install protobuf compiler
56
- run : apt-get update && apt-get install protobuf-compiler -y
57
57
- name : Install sqlx
58
58
run : cargo install sqlx-cli --no-default-features --features postgres
59
59
- name : Run the test sqlx migrations
73
73
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
74
74
- name : Install libsasl2-dev
75
75
run : apt-get update && apt-get install -y libsasl2-dev
76
+ - name : Install protobuf compiler
77
+ run : apt-get update && apt-get install protobuf-compiler -y
76
78
- name : Cache dependencies
77
79
uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
78
80
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
84
86
- name : Run sccache-cache
85
87
uses : mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
86
88
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
87
- - name : Install protobuf compiler
88
- run : apt-get update && apt-get install protobuf-compiler -y
89
89
- run : |
90
90
rustup component add clippy
91
91
# Temporarily allowing dead-code, while denying all other warnings
@@ -94,31 +94,28 @@ jobs:
94
94
test-and-coverage :
95
95
name : cargo test and coverage
96
96
runs-on : ubuntu-latest
97
- permissions :
98
- contents : write
99
- pull-requests : write
100
- actions : read
101
- services :
102
- postgres :
103
- image : postgres:15
104
- env :
105
- POSTGRES_HOST_AUTH_METHOD : trust
106
- options : >-
107
- --health-cmd pg_isready
108
- --health-interval 10s
109
- --health-timeout 5s
110
- --health-retries 5
111
- ports :
112
- - 5432:5432
113
97
container :
114
98
image : rust:1.86-bookworm
99
+ options : --privileged -v /var/run/docker.sock:/var/run/docker.sock
115
100
env :
116
- DATABASE_URL : postgres://postgres@postgres:5432
117
101
CI : true
102
+ SQLX_OFFLINE : true
103
+ DOCKER_HOST : unix:///var/run/docker.sock
118
104
steps :
119
105
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
106
+ - name : Install Docker CLI and verify
107
+ run : |
108
+ apt-get update
109
+ apt-get install -y docker.io
110
+ # Verify Docker is accessible
111
+ docker version
112
+ docker ps
113
+ # Pre-pull the postgres:15 image to avoid timeouts
114
+ docker pull postgres:15
120
115
- name : Install libsasl2-dev
121
116
run : apt-get update && apt-get install -y libsasl2-dev
117
+ - name : Install protobuf compiler
118
+ run : apt-get update && apt-get install protobuf-compiler -y
122
119
- name : Cache dependencies
123
120
uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
124
121
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
@@ -127,17 +124,11 @@ jobs:
127
124
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
128
125
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
129
126
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
130
- - name : Install protobuf compiler
131
- run : apt-get update && apt-get install protobuf-compiler -y
132
127
- name : Run sccache-cache
133
128
uses : mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
134
129
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
135
130
- name : Install cargo-llvm-cov
136
131
uses : taiki-e/install-action@cargo-llvm-cov
137
- - name : Install sqlx
138
- run : cargo install sqlx-cli --no-default-features --features postgres
139
- - name : Run the test sqlx migrations
140
- run : cargo sqlx migrate run
141
132
- name : Run tests and generate coverage report
142
133
run : cargo llvm-cov test --all-features --workspace --lcov --output-path lcov.info
143
134
- name : Upload coverage to Coveralls
@@ -149,30 +140,27 @@ jobs:
149
140
test-docs :
150
141
name : cargo test docs code snippets
151
142
runs-on : ubuntu-latest
152
- permissions :
153
- contents : write
154
- pull-requests : write
155
- actions : read
156
- services :
157
- postgres :
158
- image : postgres:15
159
- env :
160
- POSTGRES_HOST_AUTH_METHOD : trust
161
- options : >-
162
- --health-cmd pg_isready
163
- --health-interval 10s
164
- --health-timeout 5s
165
- --health-retries 5
166
- ports :
167
- - 5432:5432
168
143
container :
169
144
image : rust:1.86-bookworm
145
+ options : --privileged -v /var/run/docker.sock:/var/run/docker.sock
170
146
env :
171
- DATABASE_URL : postgres://postgres@postgres:5432
147
+ SQLX_OFFLINE : true
148
+ DOCKER_HOST : unix:///var/run/docker.sock
172
149
steps :
173
150
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
151
+ - name : Install Docker CLI and verify
152
+ run : |
153
+ apt-get update
154
+ apt-get install -y docker.io
155
+ # Verify Docker is accessible
156
+ docker version
157
+ docker ps
158
+ # Pre-pull the postgres:15 image to avoid timeouts
159
+ docker pull postgres:15
174
160
- name : Install libsasl2-dev
175
161
run : apt-get update && apt-get install -y libsasl2-dev
162
+ - name : Install protobuf compiler
163
+ run : apt-get update && apt-get install protobuf-compiler -y
176
164
- name : Cache dependencies
177
165
uses : Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3 # v2.7.7
178
166
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
@@ -181,14 +169,8 @@ jobs:
181
169
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
182
170
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
183
171
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
184
- - name : Install protobuf compiler
185
- run : apt-get update && apt-get install protobuf-compiler -y
186
172
- name : Run sccache-cache
187
173
uses : mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
188
174
if : ${{ !startsWith(github.head_ref, 'renovate/') }}
189
- - name : Install sqlx
190
- run : cargo install sqlx-cli --no-default-features --features postgres
191
- - name : Run the test sqlx migrations
192
- run : cargo sqlx migrate run
193
175
- name : Test documentation code snippets
194
176
run : cargo test --doc --all-features --workspace
0 commit comments