Skip to content

Commit 425fde2

Browse files
committed
ci: update ci for testcontainers setup
1 parent 4a57d33 commit 425fde2

File tree

1 file changed

+10
-38
lines changed

1 file changed

+10
-38
lines changed

.github/workflows/tests.yml

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -98,25 +98,15 @@ jobs:
9898
contents: write
9999
pull-requests: write
100100
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-
container:
114-
image: rust:1.86-bookworm
115101
env:
116-
DATABASE_URL: postgres://postgres@postgres:5432
117102
CI: true
103+
SQLX_OFFLINE: true
118104
steps:
119105
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
106+
- name: Install Rust
107+
uses: dtolnay/rust-toolchain@stable
108+
with:
109+
toolchain: 1.86
120110
- name: Install libsasl2-dev
121111
run: apt-get update && apt-get install -y libsasl2-dev
122112
- name: Cache dependencies
@@ -134,10 +124,6 @@ jobs:
134124
if: ${{ !startsWith(github.head_ref, 'renovate/') }}
135125
- name: Install cargo-llvm-cov
136126
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
141127
- name: Run tests and generate coverage report
142128
run: cargo llvm-cov test --all-features --workspace --lcov --output-path lcov.info
143129
- name: Upload coverage to Coveralls
@@ -153,24 +139,14 @@ jobs:
153139
contents: write
154140
pull-requests: write
155141
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-
container:
169-
image: rust:1.86-bookworm
170142
env:
171-
DATABASE_URL: postgres://postgres@postgres:5432
143+
SQLX_OFFLINE: true
172144
steps:
173145
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
146+
- name: Install Rust
147+
uses: dtolnay/rust-toolchain@stable
148+
with:
149+
toolchain: 1.86
174150
- name: Install libsasl2-dev
175151
run: apt-get update && apt-get install -y libsasl2-dev
176152
- name: Cache dependencies
@@ -186,9 +162,5 @@ jobs:
186162
- name: Run sccache-cache
187163
uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
188164
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
193165
- name: Test documentation code snippets
194166
run: cargo test --doc --all-features --workspace

0 commit comments

Comments
 (0)