-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (72 loc) · 2.63 KB
/
ci.yml
File metadata and controls
78 lines (72 loc) · 2.63 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
# Cargo CI workflow to build and test
name: Cargo CI Build & Test
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, windows-11-arm]
toolchain:
- stable
steps:
- uses: actions/checkout@v6
- uses: microsoft/setup-msbuild@v3
- uses: glslang/setup-masm@v1.2
with:
vs-architecture: ${{ matrix.os == 'windows-11-arm' && 'arm64' || 'x64' }}
- name: Install Rust
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.toolchain }}
- name: Cargo fmt
run: |
rustup component add rustfmt
cargo fmt --all -- --check
- name: Cargo update
run: cargo update
- uses: taiki-e/install-action@nextest
- name: Build
run: |
echo "=== Starting Rust build ==="
cargo build --verbose 2>&1 | tee build_output.log
echo "=== Build completed ==="
echo "=== Build output log ==="
cat build_output.log
- name: Check target/debug output
run: |
Write-Host "=== Checking for stderr and output files in target/debug/build ==="
if (Test-Path "target/debug/build") {
Write-Host "target/debug/build directory exists"
# Check for stderr and output files in all subdirectories
$outputFiles = Get-ChildItem -Path "target/debug/build" -Recurse -File | Where-Object { $_.Name -eq "stderr" -or $_.Name -eq "output" }
if ($outputFiles) {
Write-Host "=== Found stderr and output files ==="
foreach ($file in $outputFiles) {
Write-Host "=== Contents of $($file.FullName) ==="
try {
Get-Content $file.FullName
} catch {
Write-Host "Could not read $($file.FullName)"
}
}
} else {
Write-Host "No stderr or output files found in target/debug/build"
}
} else {
Write-Host "target/debug/build directory does not exist"
}
- name: Test
run: |
cargo nextest run --verbose 2>&1 | tee test_output.log
echo "=== Test completed ==="
echo "=== Test output log ==="
cat test_output.log