-
Notifications
You must be signed in to change notification settings - Fork 11
122 lines (118 loc) · 3.69 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
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
112
113
114
115
116
117
118
119
120
121
122
name: Build
on: [push, pull_request_target]
jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout (Push)
if: github.event_name == 'push'
uses: actions/checkout@v4
- name: Checkout (Pull Request)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.number }}/merge"
- name: Install packages
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install -y ninja-build gcc-13 g++-13
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 10
sudo update-alternatives --set gcc "/usr/bin/gcc-13"
sudo update-alternatives --set g++ "/usr/bin/g++-13"
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Configure ninja
run: ./configure.py
- name: Compile
run: ninja
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Kinoko
path: |
out
samples
tools
STATUS.md
format:
name: Format
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download llvm
run: wget https://apt.llvm.org/llvm.sh
- name: Install clang-format
run: |
chmod u+x llvm.sh
sudo ./llvm.sh 16
sudo apt install clang-format-16
- name: Format Kinoko
run: |
dirs="include source"
find $dirs -regex '.*\.\(c\|h\|cc\|hh\)' | xargs clang-format-16 --dry-run -Werror
verify:
name: Verify
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
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 -C out
- name: Install packages
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -y
sudo apt-get install -y libstdc++6
- name: Run Kinoko
run: cd out && chmod u+x ./kinoko && ./kinoko -m test -s testCases.bin
- name: Upload output
uses: actions/upload-artifact@v4
with:
name: Kinoko output
path: out/results.txt
- name: Validate STATUS.md up-to-date
run: sudo python3 ./tools/status_check.py
website:
name: Generate website assets
runs-on: ubuntu-latest
needs: verify
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: Kinoko
- name: Download output binary
uses: actions/download-artifact@v4
with:
name: Kinoko output
- name: Calculate progression
run: python3 tools/progress.py results.txt
- name: Install graphviz
run: sudo apt install graphviz
- name: Create doxygen dir
run: mkdir -p out/website/docs
- uses: mattnotmitt/doxygen-action@v1
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: out/website/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2