-
Notifications
You must be signed in to change notification settings - Fork 210
111 lines (95 loc) · 3.31 KB
/
minimal-ci.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
# Minimal CI workflow
# Run when someone opens a PR and adds commits to the PR (this is recognized as a push to master)
# Includes basic checks and unit/integration checks on Linux only
name: Minimal CI
env:
# Local variables
# Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480
GODOT_VER: "3.5.1-stable"
# Don't use more features like "gdnative_bindings_generator/debug" to keep CI truly minimal
GDRUST_FEATURES: "gdnative/async,gdnative/serde"
RIPGREP_VERSION: "13.0.0"
on:
pull_request:
branches:
- master
defaults:
run:
shell: bash
# If a new commit is pushed before the old one's CI has completed (on the same branch), abort previous run
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install Rust"
uses: ./.github/composite/rust
with:
rust: stable
components: rustfmt
- name: "Check rustfmt"
run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.rust == 'nightly' }}
steps:
- uses: actions/checkout@v4
- name: "Install Rust"
uses: ./.github/composite/rust
with:
rust: stable
components: clippy
- name: "Check clippy"
run: cargo clippy --workspace --features ${GDRUST_FEATURES} -- -D clippy::style -D clippy::complexity -D clippy::perf -D clippy::dbg_macro -D clippy::todo -D clippy::unimplemented -D warnings
check-todo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install ripgrep"
run: |
cd /tmp
wget --no-verbose https://github.com/BurntSushi/ripgrep/releases/download/${RIPGREP_VERSION}/ripgrep-${RIPGREP_VERSION}-x86_64-unknown-linux-musl.tar.gz -O ripgrep.tar.gz
tar -zxvf ripgrep.tar.gz
sudo mv ripgrep-${RIPGREP_VERSION}-x86_64-unknown-linux-musl/rg /usr/bin
- name: "Look for TODO comments without issue numbers attached to them"
run: bash tools/detect-todo.sh
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install Rust"
uses: ./.github/composite/rust
- name: "Compile tests"
run: cargo test --workspace --features ${GDRUST_FEATURES} --no-run
- name: "Test"
run: cargo test --workspace --features ${GDRUST_FEATURES}
integration-test-godot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Run Godot integration test"
uses: ./.github/composite/godot
with:
godot_ver: ${{ env.GODOT_VER }}
# ---------------------------------------------------------------------------------------------------------------------------------------------
# CI status report
# Job to notify merge queue about success/failure. Named the same as the one in full-ci.
ci-status:
if: always()
needs:
- rustfmt
- clippy
- check-todo
- unit-test
- integration-test-godot
runs-on: ubuntu-latest
steps:
- name: "Success"
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: "Failure"
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1