Repository navigation
69 lines (57 loc) · 2.1 KB
/
Copy pathci.yml
File metadata and controls
69 lines (57 loc) · 2.1 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
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --locked --all-targets --release -- -W clippy::all
- name: Test
run: cargo test --locked --release
- name: Build release binary
run: cargo build --locked --release
- name: Read-only diagnostics smoke test
shell: pwsh
run: |
$reportDir = Join-Path $env:RUNNER_TEMP 'game-accelerator-diagnostics'
New-Item -ItemType Directory -Path $reportDir -Force | Out-Null
$reportPath = Join-Path $reportDir 'diagnostics.toml'
$arguments = '--config-dir "{0}" --diagnose "{1}"' -f $reportDir, $reportPath
$process = Start-Process -FilePath '.\target\release\game-accelerator.exe' -ArgumentList $arguments -WindowStyle Hidden -Wait -PassThru
if ($process.ExitCode -ne 0) {
throw "Diagnostics failed with exit code $($process.ExitCode)."
}
if (-not (Test-Path -LiteralPath $reportPath -PathType Leaf)) {
throw 'Diagnostics did not create the expected report.'
}
if ((Get-Item -LiteralPath $reportPath).Length -eq 0) {
throw 'The diagnostic report is empty.'
}
- name: Package portable app
shell: pwsh
run: .\scripts\build-local.ps1 -SkipBuild
- name: Upload portable package
uses: actions/upload-artifact@v4
with:
name: GameAccelerator-windows-x64
path: |
dist/GameAccelerator-*-windows-x64.zip
dist/GameAccelerator-*-windows-x64.zip.sha256
dist/GameAccelerator/SHA256SUMS.txt
if-no-files-found: error