Repository navigation
169 lines (135 loc) · 5.21 KB
/
Copy pathtest.yml
File metadata and controls
169 lines (135 loc) · 5.21 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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Tests
# Pushes and PRs run the Linux jobs. Start macOS and Windows by hand. release.yml runs everything (suite: all)
# before it publishes.
on:
workflow_dispatch:
inputs:
suite:
description: 'Test suite to run'
required: true
default: 'all'
type: choice
options:
- all
- linux
- e2e
- macos-windows
regenerate_goldens:
description: 'Rewrite the SQL Server golden fixtures from this server and upload them'
required: false
default: false
type: boolean
workflow_call:
inputs:
suite:
description: 'all, linux, e2e or macos-windows'
default: 'all'
type: string
push:
branches: [master]
pull_request:
permissions:
contents: read
# Cancel superseded PR runs. Master, manual and release runs always finish.
concurrency:
group: tests-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
linux:
name: Lint and test (Linux)
if: ${{ !inputs.suite || inputs.suite == 'all' || inputs.suite == 'linux' }}
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- name: Install GPUI build dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang libfontconfig-dev libfreetype-dev libwayland-dev \
libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libvulkan-dev
- name: Install the pinned toolchain
run: rustup show active-toolchain || rustup toolchain install
# Only master saves caches. PRs reuse them, and the repo gets 10 GB in total.
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace --all-targets --locked --features barsql-db/e2e,barsql-app/e2e,barsql-ui/e2e,barsql/snapshot -- -D warnings
- name: Unit, SQLite and UI tests
run: cargo test --workspace --locked
e2e:
name: E2E (PostgreSQL, MySQL, MariaDB, libSQL, ClickHouse, SQL Server)
if: ${{ !inputs.suite || inputs.suite == 'all' || inputs.suite == 'e2e' }}
runs-on: ubuntu-latest
timeout-minutes: 40
# SQL Server comes with the mssql profile, and its suites run only when asked.
env:
COMPOSE_PROFILES: mssql
BARSQL_E2E_MSSQL: "1"
steps:
- uses: actions/checkout@v7
- name: Install GPUI build dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang libfontconfig-dev libfreetype-dev libwayland-dev \
libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libvulkan-dev
# Same compose file as `cargo xtask e2e up`.
- name: Start database stack
run: docker compose up -d --wait
- name: Install the pinned toolchain
run: rustup show active-toolchain || rustup toolchain install
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/master' }}
# The fixtures were first written against Azure SQL Edge on arm64. This rewrites them from SQL Server itself.
- name: Rewrite the SQL Server golden fixtures
if: ${{ inputs.regenerate_goldens }}
run: cargo test -p barsql-db --features e2e --locked --test golden_mssql
env:
BARSQL_GOLDEN_WRITE: "1"
- name: Upload the rewritten SQL Server fixtures
if: ${{ inputs.regenerate_goldens }}
uses: actions/upload-artifact@v7
with:
name: sqlserver-golden-fixtures
path: fixtures/golden/*/sqlserver.json
- name: Driver and app suites
run: cargo test -p barsql-db -p barsql-app --features barsql-db/e2e,barsql-app/e2e --locked
- name: UI scenarios per engine
run: cargo test -p barsql-ui --features e2e --locked scenarios::engines
- name: Dump database logs on failure
if: failure()
run: docker compose logs --no-color
# What the golden corpus saw instead, next to each fixture it didn't match.
- name: Upload golden mismatches
if: failure()
uses: actions/upload-artifact@v7
with:
name: golden-mismatches
path: fixtures/golden/**/*.actual.json
if-no-files-found: ignore
- name: Tear down database stack
if: always()
run: docker compose down -v
macos-windows:
name: Lint and test (${{ matrix.os }})
if: ${{ inputs.suite == 'all' || inputs.suite == 'macos-windows' }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- name: Install the pinned toolchain
run: rustup show active-toolchain || rustup toolchain install
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/master' }}
- name: Clippy
run: cargo clippy --workspace --all-targets --locked --features barsql-db/e2e,barsql-app/e2e,barsql-ui/e2e,barsql/snapshot -- -D warnings
- name: Unit, SQLite and UI tests
run: cargo test --workspace --locked