Repository navigation
117 lines (111 loc) · 4.14 KB
/
Copy pathcompile.yml
File metadata and controls
117 lines (111 loc) · 4.14 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
name: Compile
# What a pull request runs, besides hex-agent-policy: a fast compile of the app
# on Linux, macOS, and Windows x64 (cargo clippy, warnings as errors). Pull
# requests merge without waiting for it, and a breakage on dev goes to the CI
# failure pipeline. The full suites (check-linux.yml, check-macos.yml,
# check-windows.yml) run in Release's check and stable channels, and by hand.
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "Cargo.toml"
- "Cargo.lock"
- "build.rs"
- "crates/**"
- "src/**"
- "native/**"
- "resources/**"
- "assets/**"
- ".github/workflows/compile.yml"
workflow_dispatch:
permissions:
contents: read
# A new push to a pull request cancels its stale run.
concurrency:
group: compile-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
linux:
name: Linux
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-24.04
timeout-minutes: 45
env:
CARGO_PROFILE_DEV_DEBUG: "0"
BLA_VENDOR: OpenBLAS
OPENSSL_NO_VENDOR: "1"
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
cache-on-failure: true
- name: Install native libraries
run: |
sudo apt-get update
sudo apt-get install -y clang cmake pkg-config python3 libasound2-dev \
libssl-dev libgtk-3-dev libxkbcommon-x11-dev libx11-xcb-dev \
libfontconfig1-dev libfreetype-dev libxcursor-dev libxi-dev \
libxrandr-dev libopenblas-dev libvulkan-dev glslc libshaderc-dev
- run: cargo fmt --all --check
- run: cargo clippy --locked --bin hex -- -D warnings
macos:
name: macOS
if: ${{ !github.event.pull_request.draft }}
runs-on: macos-26
timeout-minutes: 45
env:
CARGO_PROFILE_DEV_DEBUG: "0"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
cache-on-failure: true
- name: Install the Metal toolchain
run: xcrun --sdk macosx metal --version || xcodebuild -downloadComponent MetalToolchain
- run: cargo clippy --locked --bin hex -- -D warnings
windows:
name: Windows x64
if: ${{ !github.event.pull_request.draft }}
runs-on: windows-latest
timeout-minutes: 60
env:
TRANSCRIBE_CMAKE_ARGS: -DGGML_NATIVE=OFF
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
cache-on-failure: true
- name: Install the Vulkan SDK
uses: humbletim/install-vulkan-sdk@30ba978f977e81b72d091fc8888feb1fb26f9aff # v1.2
with:
version: 1.4.309.0
cache: true
- name: Install SPIRV-Headers for the Vulkan backend
shell: pwsh
run: |
vcpkg install spirv-headers:x64-windows
if ($LASTEXITCODE -ne 0) { throw "vcpkg install spirv-headers failed" }
$prefix = "$env:VCPKG_INSTALLATION_ROOT/installed/x64-windows" -replace '\\','/'
$combined = if ($env:CMAKE_PREFIX_PATH) { "$prefix;$env:CMAKE_PREFIX_PATH" } else { $prefix }
Add-Content $env:GITHUB_ENV "CMAKE_PREFIX_PATH=$combined"
- run: cargo clippy --locked --bin hex -- -D warnings