-
Notifications
You must be signed in to change notification settings - Fork 11
61 lines (57 loc) · 1.73 KB
/
build.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
name: Build
on: [push, pull_request_target]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install ninja
run: sudo apt install ninja-build
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Configure G++ version
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 10
sudo update-alternatives --set gcc "/usr/bin/gcc-12"
sudo update-alternatives --set g++ "/usr/bin/g++-12"
- name: Configure ninja
run: ./configure.py
- name: Compile
run: ninja
- name: Upload result
uses: actions/upload-artifact@v3
with:
name: Kinoko
path: out
format:
name: Format
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install clang-format
run: sudo apt-get update && sudo apt-get install clang-format-15
- name: Format Kinoko
run: |
dirs="include source"
find $dirs -regex '.*\.\(c\|h\|cc\|hh\)' | xargs clang-format-15 --dry-run -Werror
verify:
name: Verify
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: Kinoko
- name: Download dependencies
run: curl -L -o Runtime.tar.gz ${{ secrets.RUNTIME_DEPENDENCIES }}
- name: Extract dependencies
run: tar -xzf Runtime.tar.gz
- name: Run Kinoko
run: chmod u+x ./kinoko && ./kinoko