-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (81 loc) · 2.42 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
92
93
94
95
96
97
98
99
100
101
102
103
104
name: CI # Continuous Integration
on:
pull_request:
paths-ignore:
- "**.md"
push:
branches:
- main
paths-ignore:
- "**.md"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Test Suite
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: davidB/rust-cargo-make@v1
- uses: Swatinem/rust-cache@v2
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Check formatting
run: cargo make format
- name: Clippy check
run: cargo make check
- name: Run Unit Tests
run: cargo make cov-ci
- name: Upload coverage data to codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true
test:
name: Integration Test
runs-on: ubuntu-latest
needs: check
env:
AUTH_URL: ${{ vars.AUTH_URL }}
DATABASE_USERNAME: nakago
DATABASE_PASSWORD: nakago
DATABASE_PORT: 1701
DATABASE_URL_ASYNC_GRAPHQL: postgresql://nakago:nakago@localhost:1701/async-graphql
CONFIG_PATH_ASYNC_GRAPHQL: examples/async-graphql/config/ci.toml
CONFIG_PATH_SIMPLE: examples/simple/config/ci.toml
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- uses: davidB/rust-cargo-make@v1
- uses: Swatinem/rust-cache@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run docker-compose
run: docker-compose -f docker-compose.yml up -d
- name: Install SQLx CLI
uses: baptiste0928/cargo-install@v2
with:
crate: sqlx-cli
args: --no-default-features --features rustls,postgres
version: latest
- name: Create Databases
run: cargo make db-create
- name: Migrate Databases
run: cargo make db-migrate
- name: Run Integration Tests
run: cargo make integration-ci