-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (94 loc) · 2.86 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
permissions:
security-events: "write"
jobs:
build:
runs-on: "ubuntu-22.04"
env:
RUSTFLAGS: "-D warnings"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install Tools
run: cargo install clippy-sarif sarif-fmt
- name: Build Debug
run: |
set -o pipefail
cargo build --workspace --all-features --message-format json | clippy-sarif | tee rust-build-results.sarif | sarif-fmt
- name: Build Debug Runtime
run: |
set -o pipefail
cargo build -p godot-rust-script --features "runtime" --message-format json | clippy-sarif | tee rust-build-results.sarif | sarif-fmt
- name: Build Debug Scripts
run: |
set -o pipefail
cargo build -p godot-rust-script --features "scripts" --message-format json | clippy-sarif | tee rust-build-results.sarif | sarif-fmt
- name: Build Release
run: |
set -o pipefail
cargo build --release --workspace --all-features --message-format json | clippy-sarif | tee rust-build-results.sarif | sarif-fmt
- name: Upload Results
uses: github/codeql-action/upload-sarif@v2
if: ${{ always() }}
with:
sarif_file: rust-build-results.sarif
wait-for-processing: true
clippy:
runs-on: "ubuntu-22.04"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install Tools
run: cargo install clippy-sarif sarif-fmt
- name: Checks
run: |
set -o pipefail
cargo clippy --message-format json --workspace --all-features -- -D warnings | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
- name: Upload Results
uses: github/codeql-action/upload-sarif@v2
if: ${{ always() }}
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true
tests:
runs-on: "ubuntu-22.04"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Tests
run: |
cargo test
license:
runs-on: "ubuntu-22.04"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install ENV
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install nushell
- name: Check License Headers
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
./license_header.nu
git diff
test $(git diff | wc -l) -eq 0