forked from torrust/torrust-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (81 loc) · 3.06 KB
/
Copy pathdb-compatibility.yaml
File metadata and controls
98 lines (81 loc) · 3.06 KB
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
name: Database Compatibility
# adr: docs/adrs/20260612000000_adopt_sccache_for_ci_bare_builds.md
# sccache added for cross-run compilation caching on bare CI builds.
# Path policy: run this workflow only for persistence-relevant changes.
# Scoped intentionally to tracker-core — the jobs call persistence methods
# directly against real database instances, so broader dependency closure
# is not required. General compile/cross-package regressions are covered by
# the Testing workflow.
# See .github/workflows/docs-lint.yaml for the lightweight docs-only workflow.
on:
push:
paths:
- "packages/tracker-core/**"
- ".github/workflows/db-compatibility.yaml"
pull_request:
paths:
- "packages/tracker-core/**"
- ".github/workflows/db-compatibility.yaml"
env:
CARGO_TERM_COLOR: always
jobs:
database-compatibility-mysql:
name: Database Compatibility MySQL (${{ matrix.mysql-version }})
runs-on: ubuntu-latest
strategy:
matrix:
mysql-version: ["8.0", "8.4"]
steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v6
- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- id: sccache
name: Install sccache (GHA backend)
uses: mozilla-actions/sccache-action@v0.0.10
- id: enable-sccache
name: Enable sccache
run: |
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
- id: database
name: Run Database Compatibility Test
env:
TORRUST_TRACKER_CORE_RUN_MYSQL_DRIVER_TEST: "true"
TORRUST_TRACKER_CORE_MYSQL_DRIVER_IMAGE_TAG: ${{ matrix.mysql-version }}
run: cargo test -p torrust-tracker-core --features db-compatibility-tests run_mysql_driver_tests -- --nocapture
database-compatibility-postgres:
name: Database Compatibility PostgreSQL (${{ matrix.postgres-version }})
runs-on: ubuntu-latest
strategy:
matrix:
postgres-version: ["14", "15", "16", "17"]
steps:
- id: checkout
name: Checkout Repository
uses: actions/checkout@v6
- id: setup
name: Setup Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- id: sccache
name: Install sccache (GHA backend)
uses: mozilla-actions/sccache-action@v0.0.10
- id: enable-sccache
name: Enable sccache
run: |
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
- id: database
name: Run Database Compatibility Test
env:
TORRUST_TRACKER_CORE_RUN_POSTGRES_DRIVER_TEST: "true"
TORRUST_TRACKER_CORE_POSTGRES_DRIVER_IMAGE_TAG: ${{ matrix.postgres-version }}
run: cargo test -p torrust-tracker-core --features db-compatibility-tests run_postgres_driver_tests -- --nocapture