-
Notifications
You must be signed in to change notification settings - Fork 4
192 lines (184 loc) · 5.63 KB
/
build.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: Build Pipeline
on:
push:
branches:
- main
- master
- staging
- trying
- "renovate/**"
tags:
- "*"
pull_request:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: '0'
CARGO_PROFILE_DEV_DEBUG: '0'
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
RUST_LOG: "info"
jobs:
# Identify unused dependencies
run_udeps:
name: Run Cargo Udeps
runs-on: ubuntu-latest
env:
RUSTC_BOOTSTRAP: 1
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install libvncserver-dev
run: sudo apt update && sudo apt install -y libvncserver-dev
- uses: actions-rs/cargo@v1
with:
command: install
args: cargo-udeps --locked
- uses: actions-rs/cargo@v1
with:
command: udeps
run_rustfmt:
name: Run Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true
- name: Install libvncserver-dev
run: sudo apt update && sudo apt install -y libvncserver-dev
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run_clippy:
name: Run Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: clippy
override: true
- name: Install libvncserver-dev
run: sudo apt update && sudo apt install -y libvncserver-dev
- name: Run clippy action to produce annotations
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions-rs/clippy-check@v1
if: env.GITHUB_TOKEN != null
with:
args: --all-targets -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy manually without annotations
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: env.GITHUB_TOKEN == null
run: cargo clippy --all-targets -- -D warnings
run_rustdoc:
name: Run RustDoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true
- name: Install libvncserver-dev
run: sudo apt update && sudo apt install -y libvncserver-dev
- uses: actions-rs/cargo@v1
with:
command: doc
args: --document-private-items
run_tests:
name: Run Cargo Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- name: Install libvncserver-dev
run: sudo apt update && sudo apt install -y libvncserver-dev
- name: Test with all features turned off
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --all-targets
- name: Test with all features turned on
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --all-targets
- name: Test vnc feature
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features vnc --all-targets
run_build:
name: Build for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
file-suffix: ""
# - target: x86_64-pc-windows-gnu
# os: windows-latest
# file-suffix: ".exe"
- target: x86_64-apple-darwin
os: macos-latest
file-suffix: ""
- target: aarch64-apple-darwin
os: macos-latest
file-suffix: ""
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: ${{ matrix.target }}
override: true
- name: Print CPU architecture
run: uname -m && uname -a
- if: runner.os == 'Linux'
run: sudo apt update && sudo apt install -y libvncserver-dev
- if: runner.os == 'macOS'
run: brew install libvncserver
# - if: runner.os == 'Windows'
# uses: egor-tensin/setup-cygwin@v3
# with:
# platform: x64
# packages: pkg-config libvncserver-devel
- uses: actions-rs/cargo@v1
with:
command: build
args: --target=${{ matrix.target }} --no-default-features
# Currently the macOS build is broken because of
#
# error: failed to run custom build command for `vncserver v0.2.2 (https://github.com/sbernauer/libvnc-rs.git#2bf903ad)`
# thread 'main' panicked at /Users/runner/.cargo/git/checkouts/libvnc-rs-5fba04f2b7022219/2bf903a/vncserver/build.rs:9:66:
# called `Result::unwrap()` on an `Err` value: pkg-config has not been configured to support cross-compilation.
#
# This is because GitHub switched their macOS runners to use arm, and they currently can not cross-compile to x86.
# What a time to be alive!
#
# - uses: actions-rs/cargo@v1
# with:
# command: build
# args: --target=${{ matrix.target }} --all-features