-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (83 loc) · 2.05 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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
checks: write
contents: write
pull-requests: write
env:
RUSTFLAGS: "-Dwarnings"
BUILD_ID: ${{ github.job }}-${{ github.run_id }}
# Latest Node.js version: https://nodejs.org/en
NODE_VERSION: 22.9.0
# Latest Rust version: https://www.rust-lang.org/
RUST_VERSION: 1.81.0
jobs:
nodejs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install
run: npm install --omit=dev
working-directory: ./ui
- name: Lint
run: npm run lint
working-directory: ./ui
- name: Test
run: npm run test
working-directory: ./ui
- name: Build
run: npm run build
working-directory: ./ui
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Rust version
run: |
if [ "$(rustc --version | awk '{ print $2 }')" != "$RUST_VERSION" ]; then
rustup update "$RUST_VERSION"
rustup default "$RUST_VERSION"
rustup component add clippy
fi
- name: Lint
run: cargo clippy --all-targets --all-features
- name: Test
run: cargo test
ci:
needs:
- nodejs
- rust
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Build CI
run: |
docker \
build \
-t wiki-ci:build-$BUILD_ID \
-f images/build.Dockerfile \
.
docker \
run \
--rm \
-v ${{ github.workspace }}:${{ github.workspace }} \
-w ${{ github.workspace }} \
wiki-ci:build-$BUILD_ID \
sh -c 'cargo build --bin ci'
- name: Run CI
run: ./target/debug/ci -v --github-logger --all
- name: Test Results
uses: dorny/test-reporter@v1
with:
name: Wiki CI Test Results
path: test_results/*.xml
reporter: java-junit
if: always()