-
-
Notifications
You must be signed in to change notification settings - Fork 20
99 lines (79 loc) · 2.84 KB
/
rust_test.yml
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
name: Rust Tests
on:
pull_request:
branches: [main]
paths:
- "windSend-rs/**"
- "!windSend-rs/.gitingore"
workflow_dispatch:
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-22.04]
rust: [stable]
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libxdo-dev libappindicator3-dev
- name: Install NASM for tokio-rustls(aws-lc-rs) on Windows
if: matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1
- name: Install ninja-build tool for tokio-rustls(aws-lc-rs) on Windows
if: matrix.os == 'windows-latest'
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Build ${{ matrix.os }}
working-directory: ./windSend-rs
run: cargo build --verbose
- name: Run clippy
working-directory: ./windSend-rs
run: cargo clippy --verbose
- name: Run fmt
working-directory: ./windSend-rs
run: cargo fmt -- --check
- name: Run tests
working-directory: ./windSend-rs
run: cargo test --verbose
build-aarch64-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: aarch64-pc-windows-msvc
- name: Install NASM for tokio-rustls(aws-lc-rs) on Windows
uses: ilammy/setup-nasm@v1
- name: Install ninja-build tool for tokio-rustls(aws-lc-rs) on Windows
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Build aarch64-pc-windows-msvc
working-directory: ./windSend-rs
run: cargo build --target aarch64-pc-windows-msvc --verbose
build-x86_64-unknown-linux-musl:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-musl
- name: Install dependencies on Ubuntu
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libxdo-dev libappindicator3-dev
sudo apt-get install -y pkg-config libssl-dev build-essential linux-libc-dev
sudo apt-get install -y musl-dev musl-tools
- name: Build x86_64-unknown-linux-musl
working-directory: ./windSend-rs
run: cargo build --target x86_64-unknown-linux-musl --verbose
- name: Run tests
working-directory: ./windSend-rs
run: cargo test --verbose