-
Notifications
You must be signed in to change notification settings - Fork 189
125 lines (103 loc) · 3.38 KB
/
Copy pathci-linux.yml
File metadata and controls
125 lines (103 loc) · 3.38 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: CI (Linux)
on:
push:
branches: [main]
paths:
- 'platforms/linux/**'
- 'portkiller-core/**'
- '.github/workflows/ci-linux.yml'
tags-ignore:
- 'v*'
pull_request:
branches: [main]
paths:
- 'platforms/linux/**'
- 'portkiller-core/**'
- '.github/workflows/ci-linux.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust:
name: Rust Core (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
portkiller-core/target
key: ${{ runner.os }}-cargo-${{ hashFiles('portkiller-core/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install scan tools
# The scanner shells out to these; without them the integration
# tests fail rather than exercising the real code paths.
run: sudo apt-get update -qq && sudo apt-get install -y -qq procps iproute2 lsof
- name: Build
working-directory: portkiller-core
run: cargo build --verbose
- name: Test
working-directory: portkiller-core
run: cargo test --verbose
- name: Clippy
working-directory: portkiller-core
run: cargo clippy -- -D warnings
- name: Format check
working-directory: portkiller-core
run: cargo fmt --check
python:
name: Linux Tray App
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Syntax check
run: python3 -m compileall -q platforms/linux/src platforms/linux/port-killer.py
- name: Run parser tests
# These cover pure string parsing only, so no GTK stack is needed.
run: python3 -m unittest discover -s platforms/linux/tests -v
- name: Validate installer
run: |
bash -n platforms/linux/install.sh
sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck
shellcheck platforms/linux/install.sh
smoke:
name: Import Smoke Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install GTK stack
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq \
python3-gi python3-gi-cairo gir1.2-gtk-3.0 \
gir1.2-ayatanaappindicator3-0.1 xvfb
- name: Import all modules
# Catches broken imports and syntax errors that the parser tests,
# which never touch the GTK modules, would miss.
run: |
cd platforms/linux
xvfb-run -a python3 -c "
import src.config, src.scanner
import src.services.clipboard, src.services.cloudflare, src.services.k8s
import src.ui.dialogs, src.ui.window, src.ui.tray
print('All modules import cleanly')
"