Repository navigation
108 lines (100 loc) · 3.92 KB
/
Copy pathrust.yml
File metadata and controls
108 lines (100 loc) · 3.92 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
name: Rust
on:
push:
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- name: Check format
run: cargo fmt --all --check
- name: Run clippy
run: cargo clippy --workspace --all-targets -- -D warnings
debug-build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get -y update
sudo apt-get install -y gcc-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu
- name: Install dlltool
if: matrix.target == 'x86_64-pc-windows-msvc'
run: |
choco install msys2
C:\tools\msys64\usr\bin\bash.exe -l -c "pacman -S --noconfirm --needed base-devel mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-nasm"
echo "C:\tools\msys64\ucrt64\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Build
run: cargo build --verbose --manifest-path halide-cache/Cargo.toml --target ${{ matrix.target }}
- name: Build server
if: matrix.target != 'x86_64-pc-windows-msvc'
run: cargo build --verbose --manifest-path halide-cache-server/Cargo.toml --target ${{ matrix.target }}
server-musl-build:
strategy:
matrix:
target:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- uses: taiki-e/setup-cross-toolchain-action@12b7ad4acfa95a1476779d6c06699b96ec1691f8 # v1.42.0
with:
target: ${{ matrix.target }}
- name: Build server
run: cargo build --release --manifest-path halide-cache-server/Cargo.toml --target ${{ matrix.target }}
- name: Check the binary is static
run: |
file target/${{ matrix.target }}/release/halide-cache-server
file target/${{ matrix.target }}/release/halide-cache-server | grep -q 'static'
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- name: Test
run: cargo test --workspace
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- name: Test the client
run: cargo test --workspace --exclude halide-cache-server
check-releasable:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- uses: taiki-e/upload-rust-binary-action@f0d45ae91ee7b8ee928de7a9d04d893a08bcbec6 # v1.30.2
with:
dry-run: true
manifest-path: halide-cache/Cargo.toml
bin: halide-cache
archive: app-$target
target: x86_64-unknown-linux-gnu
- uses: taiki-e/setup-cross-toolchain-action@12b7ad4acfa95a1476779d6c06699b96ec1691f8 # v1.42.0
with:
target: x86_64-unknown-linux-musl
- uses: taiki-e/upload-rust-binary-action@f0d45ae91ee7b8ee928de7a9d04d893a08bcbec6 # v1.30.2
with:
dry-run: true
manifest-path: halide-cache-server/Cargo.toml
bin: halide-cache-server
archive: halide-cache-server-$target
target: x86_64-unknown-linux-musl