-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (82 loc) · 2.45 KB
/
ci.yml
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
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:16.1-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
POSTGRES_DB: test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--name postgres_container
s3:
image: bitnami/minio:2023
ports:
- "9000:9000"
volumes:
- storage:/data
env:
MINIO_ROOT_USER: lyonkit
MINIO_ROOT_PASSWORD: lyonkit-s3-secret
options: >-
--health-cmd "curl -f http://localhost:9000/minio/health/live"
--health-interval 30s
--health-timeout 20s
--health-retries 3
--name s3_container
env:
DATABASE_URL: postgresql://postgres:root@localhost:5432/test
RUST_LOG: warn
TEST_LOG: true
RUST_BACKTRACE: full
S3__ENDPOINT: "http://localhost:9000"
S3__BASE_URL: "http://localhost:9000"
S3__CREDENTIALS__ACCESS_KEY_ID: lyonkit
S3__CREDENTIALS__SECRET_ACCESS_KEY: lyonkit-s3-secret
S3__REGION: us-west-1
steps:
- name: Configure Postgres
run: |
docker exec -i postgres_container sed -i -e 's/max_connections = 100/max_connections = 1000/' /var/lib/postgresql/data/postgresql.conf &&
docker exec -i postgres_container sed -i -e 's/shared_buffers = 128MB/shared_buffers = 2GB/' /var/lib/postgresql/data/postgresql.conf &&
docker restart -t 0 postgres_container
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
key: v1 # increment this to bust the cache if needed
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- --no-deps
- uses: taiki-e/install-action@nextest
- name: Test
uses: actions-rs/cargo@v1
with:
command: nextest
args: run --all