Repository navigation
124 lines (103 loc) · 4.06 KB
/
Copy pathci.yml
File metadata and controls
124 lines (103 loc) · 4.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
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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-11-arm, macos-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
# Puts stackql on PATH so the integration tests run instead of being
# skipped. They use metadata statements and the built-in provider only:
# no credentials and no provider downloads.
- uses: stackql/setup-stackql@v2
if: matrix.os == 'windows-latest'
# The MSI for Arm ships the engine built for Arm. The tests run against
# that one, from the release archive, and not against the x64 engine
# under emulation.
- name: Install stackql from the release archive (Windows on Arm)
if: matrix.os == 'windows-11-arm'
shell: pwsh
working-directory: ${{ runner.temp }}
run: |
$base = 'https://github.com/stackql/stackql/releases/latest/download'
curl.exe -fsSL -O "$base/stackql_windows_arm64.zip"
curl.exe -fsSL -O "$base/stackql_windows_arm64.zip.sha256"
$want = ((Get-Content stackql_windows_arm64.zip.sha256) -split '\s+')[0].ToLower()
$have = (Get-FileHash stackql_windows_arm64.zip -Algorithm SHA256).Hash.ToLower()
if ($want -ne $have) { throw 'The archive does not match its checksum.' }
Expand-Archive stackql_windows_arm64.zip -DestinationPath stackql-arm64
$folder = (Resolve-Path stackql-arm64).Path
Get-ChildItem $folder | Format-Table Name, Length
Add-Content -Path $env:GITHUB_PATH -Value $folder
# On macOS the setup action installs with Homebrew, which has v0.12.824.
# The tests rely on the current release, so the release package is
# installed instead. It puts stackql in /usr/local/bin.
- name: Install stackql from the release package (macOS)
if: runner.os == 'macOS'
working-directory: ${{ runner.temp }}
run: |
base=https://github.com/stackql/stackql/releases/latest/download
curl -fsSL -O "$base/stackql_darwin_multiarch.pkg"
curl -fsSL -O "$base/stackql_darwin_multiarch.pkg.sha256"
shasum -a 256 -c stackql_darwin_multiarch.pkg.sha256
sudo installer -pkg stackql_darwin_multiarch.pkg -target /
- name: Tool versions
shell: bash
run: |
node --version
node -p "'node is built for ' + process.arch"
npm --version
rustc -vV
cargo --version
stackql --version
- name: Install webview dependencies
run: npm ci
- name: Lint and format check (webview)
run: npm run lint
- name: Typecheck (webview)
run: npm run typecheck
- name: Test (webview)
run: npm test
- name: Format check (host)
working-directory: src-tauri
run: cargo fmt --check
- name: Lint (host)
working-directory: src-tauri
run: cargo clippy --all-targets -- -D warnings
- name: Test (host)
working-directory: src-tauri
run: cargo test
# Builds the webview bundle and the host together, without installers.
- name: Debug build
run: npm run tauri build -- --debug --no-bundle
# The binaries the StackQL installers take, built on every run by the
# workflow a release uses: the Windows executable for each processor, the
# Mac app, and the three of them under the names a release gives them. It
# does not wait for the checks, so a failing test still leaves a build.
build:
name: Build
uses: ./.github/workflows/build.yml