Skip to content

Commit a48b13f

Browse files
committed
ci: fix ci for testing
1 parent 76207e6 commit a48b13f

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DATABASE_URL=postgresql://user:[email protected]:8001/godsaeng
2+
REDIS_URL=redis://127.0.0.1:6379
3+
SECRET_KEY=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

.github/workflows/rust.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,39 @@ jobs:
4444
test:
4545
name: ✅ Test Suite
4646
runs-on: ubuntu-latest
47+
services:
48+
postgres:
49+
image: postgres:14
50+
ports:
51+
- 8001:5432
52+
redis:
53+
image: redis:7
54+
ports:
55+
- 6379:6379
4756
steps:
4857
- uses: actions/checkout@v2
4958
- uses: actions-rs/toolchain@v1
5059
with:
5160
toolchain: stable
5261
override: true
5362
- uses: Swatinem/rust-cache@v1
63+
with:
64+
key: sqlx-0.6.2
65+
- name: Install sqlx-cli
66+
run:
67+
cargo install sqlx-cli
68+
--version=0.6.2
69+
--features rustls,postgres
70+
--no-default-features
71+
--locked
72+
- name: Migrate database
73+
run: |
74+
sudo apt-get install libpq-dev -y
75+
sudo SKIP_DOCKER=true bash ./scripts/init_db.sh
76+
- name: Migrate redis
77+
run: |
78+
./scripts/init_redis.sh
79+
5480
- name: Install cargo-nextest
5581
uses: baptiste0928/cargo-install@v1
5682
with:

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,4 @@
77
Cargo.lock
88

99
# These are backup files generated by rustfmt
10-
**/*.rs.bk
11-
12-
## env file
13-
.env
10+
**/*.rs.bk

0 commit comments

Comments
 (0)