-
Notifications
You must be signed in to change notification settings - Fork 2
125 lines (118 loc) · 4.34 KB
/
test.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: test
on:
push:
branches: [develop]
pull_request:
merge_group:
permissions:
contents: read
jobs:
unit:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo test --no-fail-fast --all-features --bins --lib
- run: cargo test --no-fail-fast --all-features --doc
postgres:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: echo 'database.url = "postgres://academy@localhost/academy"' > config.extra.toml
- run: cargo test -p academy_persistence_postgres --no-fail-fast --all-features --test '*'
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.extra.toml:${{ github.workspace }}/config.dev.toml
RUST_TEST_THREADS: 1
services:
postgres:
image: postgres:17-alpine
ports:
- '5432:5432'
env:
POSTGRES_USER: academy
POSTGRES_DB: academy
POSTGRES_HOST_AUTH_METHOD: trust
valkey:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: echo 'cache.url = "redis://localhost"' > config.extra.toml
- run: cargo test -p academy_cache_valkey --no-fail-fast --all-features --test '*'
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.extra.toml:${{ github.workspace }}/config.dev.toml
RUST_TEST_THREADS: 1
services:
valkey:
image: valkey/valkey:8.0-alpine
ports:
- '6379:6379'
email:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: echo 'email.smtp_url = "smtp://academy:academy@localhost:25"' > config.extra.toml
- run: cargo test -p academy_email_impl --no-fail-fast --all-features --test '*'
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.extra.toml:${{ github.workspace }}/config.dev.toml
SMTP4DEV_URL: http://localhost:80
RUST_TEST_THREADS: 1
services:
smtp4dev:
image: rnwood/smtp4dev:3.6.1
env:
ServerOptions__AuthenticationRequired: "true"
ServerOptions__Users__0__Username: academy
ServerOptions__Users__0__Password: academy
ports:
- '25:25'
- '80:80'
extern:
runs-on: ubuntu-latest
if: ${{ !(github.event_name == 'push' && github.actor == 'github-merge-queue[bot]') }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: cargo build --bin academy-testing
- name: test recaptcha
run: |
cargo run --bin academy-testing -- recaptcha &
while ! curl -s http://127.0.0.1:8001; do sleep .1; done
cargo test -p academy_extern_impl --no-fail-fast --all-features --test recaptcha
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.dev.toml
- name: test oauth2
run: |
cargo run --bin academy-testing -- oauth2 &
while ! curl -s http://127.0.0.1:8002; do sleep .1; done
cargo test -p academy_extern_impl --no-fail-fast --all-features --test oauth2
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.dev.toml
- name: test vat
run: |
cargo run --bin academy-testing -- vat &
while ! curl -s http://127.0.0.1:8003; do sleep .1; done
cargo test -p academy_extern_impl --no-fail-fast --all-features --test vat
env:
ACADEMY_CONFIG: ${{ github.workspace }}/config.dev.toml