-
Notifications
You must be signed in to change notification settings - Fork 5
116 lines (114 loc) · 3.86 KB
/
code_validation.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
on:
push:
paths:
- '.github/workflows/code_validation.yml' # Run when this workflow changes
- '**/Cargo.toml' # Run when dependencies change
- '**/Cargo.lock' # Run when dependencies change
- '**/src/**'
branches: [main]
pull_request:
paths:
- '.github/workflows/code_validation.yml' # Run when this workflow changes
- '**/Cargo.toml' # Run when dependencies change
- '**/Cargo.lock' # Run when dependencies change
- '**/src/**'
branches: [main]
workflow_dispatch: # Run when manually triggered
workflow_call: # Run when called by another workflow
name: ✔ Code Validation
jobs:
code_validation_job:
name: ${{ matrix.job_name }}
if: |
!startsWith(github.event.head_commit.message, 'chore:')
&& !startsWith(github.event.head_commit.message, 'chore(')
strategy:
fail-fast: false
matrix:
platform:
- linux
- windows
- apple
cpu_architecture:
- x86_64
- aarch64
subcommand:
- fmt
- clippy
- check
- test
# - doc
# - build
include:
- platform: linux
cicd_runner: ubuntu-latest
- platform: windows
cicd_runner: windows-latest
- platform: apple
cicd_runner: macos-latest
- use_cross: true
- compilation_target: x86_64-unknown-linux-gnu
cpu_architecture: x86_64
platform: linux
toolchain: gnu
use_cross: false
- compilation_target: x86_64-pc-windows-msvc
cpu_architecture: x86_64
platform: windows
toolchain: msvc
use_cross: false
- compilation_target: x86_64-apple-darwin
cpu_architecture: x86_64
platform: apple
toolchain: darwin
use_cross: false
- compilation_target: aarch64-unknown-linux-gnu
cpu_architecture: aarch64
platform: linux
toolchain: gnu
- compilation_target: aarch64-pc-windows-msvc
cpu_architecture: aarch64
platform: windows
toolchain: msvc
use_cross: false # No Cross image for this yet
- compilation_target: aarch64-apple-darwin
cpu_architecture: aarch64
platform: apple
toolchain: darwin
use_cross: false # No Cross image for this yet
- subcommand: fmt
job_name: 📑 Format Job
arguments: '--verbose -- --check'
- subcommand: clippy
job_name: 📎 Clippy Job
arguments: '--workspace -- -D warnings'
- subcommand: check
job_name: ✅ Check Job
arguments: '--workspace'
- subcommand: test
job_name: 🧪 Test Job
arguments: '--workspace'
# - subcommand: doc
# job_name: 📜 Documentation Job
# arguments: '--workspace --all-features --no-deps --document-private-items'
# - subcommand: build
# job_name: 🔨 Build Job
# arguments: '--workspace --all-features --release'
runs-on: ${{ matrix.cicd_runner }}
steps:
- name: ↕️ Install Ubuntu Dependencies Step
id: dependencies_install_step
if: ${{ matrix.compilation_target == 'x86_64-unknown-linux-gnu' }}
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-4-dev
version: 1.0
- name: ${{ matrix.job_name }}
id: task_step
uses: pax-hub/rust-github-action@main
with:
subcommand: ${{ matrix.subcommand }}
arguments: ${{ matrix.arguments }}
rust_release_channel: nightly
use_cross: ${{ matrix.use_cross }}
compilation_target: ${{ matrix.compilation_target }}