-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (67 loc) · 1.57 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
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
RUSTFLAGS: "-Dwarnings"
BUILD_ID: ${{ github.job }}-${{ github.run_id }}
ESLINT_USE_FLAT_CONFIG: false
jobs:
nodejs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 21.7.3
- 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: |
rustup update 1.77.2 &&\
rustup default 1.77.2 &&\
rustup component add clippy
- 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 --github-logger --all