-
Notifications
You must be signed in to change notification settings - Fork 7
115 lines (99 loc) · 3.64 KB
/
ci-nym-vpn-desktop-rust.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: ci-nym-vpn-desktop-rust
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "nym-vpn-x/**"
- "nym-vpn-apple/**"
- "nym-vpn-android/**"
env:
CARGO_TERM_COLOR: always
AGENT_ISSELFHOSTED: 1 # https://github.com/actions/setup-go/issues/432
jobs:
check:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04-arc, custom-runner-mac-m1, custom-windows-11]
runs-on: ${{ matrix.os }}
steps:
- name: "Cleanup working directory"
if: contains(matrix.os, 'custom')
shell: bash
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- name: Install system dependencies
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get update && sudo apt-get install -y libdbus-1-dev libmnl-dev libnftnl-dev \
protobuf-compiler libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev \
libgtk-3-dev squashfs-tools libayatana-appindicator3-dev git curl gcc g++ make
- name: Support longpaths on windows
if: contains(matrix.os, 'windows')
run: git config --system core.longpaths true
- name: Checkout
uses: actions/checkout@v4
- name: Install rust toolchain
if: "!contains(matrix.os, 'windows')"
id: rust-toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install rust toolchain (Windows)
if: contains(matrix.os, 'windows')
uses: brndnmtthws/rust-action-rustup@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Set env
shell: bash
run: |
if ${{ contains(matrix.os, 'ubuntu-20.04') }}; then
platform_arch=ubuntu-20.04_x86_64
triplet=x86_64-unknown-linux-gnu
elif ${{ contains(matrix.os, 'ubuntu-22.04') }}; then
platform_arch=ubuntu-22.04_x86_64
triplet=x86_64-unknown-linux-gnu
elif ${{ matrix.os == 'macos-12' || matrix.os == 'macos-13' }}; then
platform_arch=macos_x86_64
triplet=x86_64-apple-darwin
elif ${{ contains(matrix.os, 'macos') || contains(matrix.os, 'mac-m1') }}; then
# platform_arch=macos_aarch64
platform_arch=macos_universal
triplet=universal-apple-darwin
elif ${{ contains(matrix.os, 'windows') }}; then
triplet=x86_64-pc-windows-msvc
else
echo " ✗ unknown platform/arch [${{ matrix.os }}]"
exit 1
fi
echo " ✓ PLATFORM_ARCH: $platform_arch"
echo " ✓ TRIPLET: $triplet"
echo "PLATFORM_ARCH=$platform_arch" >> $GITHUB_ENV
echo "TRIPLET=$triplet" >> $GITHUB_ENV
echo "RUSTFLAGS=-L ${GITHUB_WORKSPACE}/build/lib/${triplet}" >> $GITHUB_ENV
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Install protoc
uses: arduino/setup-protoc@v2
if: contains(matrix.os, 'macos') || contains(matrix.os, 'mac-m1') || contains(matrix.os, 'windows')
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup MSBuild.exe
if: contains(matrix.os, 'windows')
uses: microsoft/setup-msbuild@v2
- name: Build wireguard
shell: bash
run: |
./wireguard/build-wireguard-go.sh
- name: rustfmt check
working-directory: nym-vpn-desktop/src-tauri
run: cargo fmt --check
- name: clippy check
working-directory: nym-vpn-desktop/src-tauri
run: cargo clippy -- -Dwarnings