-
-
Notifications
You must be signed in to change notification settings - Fork 1
198 lines (171 loc) Β· 5.06 KB
/
Copy pathmakefile.yml
File metadata and controls
198 lines (171 loc) Β· 5.06 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: Build OS
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
buildcompiler:
name: Build Cross-Compiler & Toolchain
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Cache cross Folder
id: cache-cross
uses: actions/cache@v5
with:
path: tools/cross
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
- name: Prepare Environment for Dev Container
run: |
sudo mkdir -p /tmp/.X11-unix
sudo mkdir -p /run/user/1000/pulse
sudo touch /run/user/1000/pulse/native
sudo touch /run/user/1000/xauth_ci
env:
XAUTHORITY: /run/user/1000/xauth_ci
XDG_RUNTIME_DIR: /run/user/1000
DISPLAY: :0
WAYLAND_DISPLAY: wayland-0
- name: Run make ci-setup in dev container
if: steps.cache-cross.outputs.cache-hit != 'true'
uses: devcontainers/ci@v0.3
with:
push: never
runCmd: |
/usr/bin/make ci-setup
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
needs: [buildcompiler]
permissions:
security-events: write
packages: read
actions: read
contents: read
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: manual
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Check for cache
id: check-cache
run: |
if [ -z "${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}" ]; then
echo "No cache found, cancelling job."
exit 1
fi
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 0
- name: Install Packages
run: |
sudo apt update
sudo apt --no-install-recommends -y install rustc xorriso mtools genisoimage ovmf nasm doxygen make gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 mingw-w64 build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev texinfo
make --quiet -C tools do_limine
make --quiet prepare
- name: Cache cross
id: cache-cross
uses: actions/cache@v5
with:
path: tools/cross
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
- name: Build OS
run: |
make build_userspace
make build_drivers
make build_kernel
make build_userspace
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
compile:
name: Build ${{ matrix.arch }} (${{ matrix.type }})
runs-on: ubuntu-latest
needs: [buildcompiler]
strategy:
fail-fast: false
matrix:
arch: [amd64, i386, arm, aarch64]
type: [debug, release]
steps:
- name: Checkout ποΈ
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Cache cross Folder πΎ
id: cache-cross
uses: actions/cache@v5
with:
path: tools/cross
key: ${{ runner.os }}-cross-${{ hashFiles('tools/Makefile') }}
- name: Prepare Environment for Dev Container
run: |
sudo mkdir -p /tmp/.X11-unix
sudo mkdir -p /run/user/1000/pulse
sudo touch /run/user/1000/pulse/native
sudo touch /run/user/1000/xauth_ci
env:
XAUTHORITY: /run/user/1000/xauth_ci
XDG_RUNTIME_DIR: /run/user/1000
DISPLAY: :0
WAYLAND_DISPLAY: wayland-0
- name: Build ποΈ
uses: devcontainers/ci@v0.3
with:
push: never
runCmd: /usr/bin/make __ci-${{ matrix.arch }}-${{ matrix.type }}
- name: Build Prepare Archive π¦
if: always()
uses: devcontainers/ci@v0.3
with:
push: never
runCmd: /usr/bin/make __ci-prepare-archive
- name: Upload Artifact π
if: always()
uses: actions/upload-artifact@v6
with:
name: build-${{ matrix.arch }}-${{ matrix.type }}
path: artifacts/
nightly:
if: always()
name: Upload Nightly Build to GitHub Releases
runs-on: ubuntu-latest
needs: [compile]
steps:
- name: Checkout ποΈ
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Download All Builds πΎ
uses: actions/download-artifact@v7
with:
path: artifacts
merge-multiple: true
- name: Update Nightly π
run: gh release upload nightly artifacts/* -R ${{github.repository}} --clobber
env:
GH_TOKEN: ${{ github.token }}