-
Notifications
You must be signed in to change notification settings - Fork 29
94 lines (76 loc) · 2.14 KB
/
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
on:
push:
pull_request:
workflow_dispatch:
# Run automatically every monday
schedule:
- cron: 1 12 * * 1
name: CI
jobs:
clippy:
name: Clippy
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-4-dev build-essential
version: 2
- uses: Swatinem/rust-cache@v2
- name: Install stable components
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --verbose --release -- -D warnings
build_and_test:
name: Build and test
strategy:
fail-fast: false
matrix:
os: ['macos-latest', 'ubuntu-22.04', 'windows-latest']
rust: ['stable', '1.57']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-4-dev build-essential
version: 2
if: startsWith(matrix.os, 'ubuntu-')
- name: Install dependencies (macOS)
run: brew install gtk4 pkg-config
if: matrix.os == 'macos-latest'
- name: vcpkg build
uses: johnwason/vcpkg-action@v5
id: vcpkg
with:
pkgs: pkgconf gtk
triplet: x64-windows-release
token: ${{ github.token }}
if: matrix.os == 'windows-latest'
- uses: Swatinem/rust-cache@v2
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Test
uses: GabrielBB/xvfb-action@v1
with:
run: cargo test --features=test-ui-replay
- uses: actions/upload-artifact@v2
with:
name: Packetry ${{ matrix.os }}
path: |
target/release/packetry
target/release/packetry.exe