Skip to content

Commit 9c5b351

Browse files
committed
Add GH Actions
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent 36f8cce commit 9c5b351

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

.github/workflows/ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
on:
3+
push:
4+
5+
jobs:
6+
build:
7+
name: Build
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Build native
13+
run: make native
14+
15+
- name: Install cosmopolitan
16+
run: |
17+
# Avoid launching MZ exe in wine
18+
sudo wget -O /usr/bin/ape https://cosmo.zip/pub/cosmos/bin/ape-$(uname -m).elf
19+
sudo chmod +x /usr/bin/ape
20+
sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
21+
sudo sh -c "echo ':APE-jart:M::jartsr::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
22+
23+
mkdir cosmopolitan
24+
wget https://cosmo.zip/pub/cosmocc/cosmocc.zip
25+
unzip -d cosmopolitan cosmocc.zip
26+
27+
# Make sure it works
28+
./cosmopolitan/bin/make --version
29+
30+
- name: Build cosmopolitan
31+
run: make COSMOCC=./cosmopolitan
32+
33+
- name: Upload Cosmopolitan EXE
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: gpu_cfg_gen.exe
37+
path: gpu_cfg_gen.exe

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
.PHONY: native clean
22

3+
COSMOCC=../cosmopolitan
4+
35
gpu_cfg_generator.exe: gpu_cfg_generator
46
cp gpu_cfg_gen gpu_cfg_gen.exe
57

68
gpu_cfg_generator: gpu_cfg_generator.c gpu_cfg_generator.h
7-
../cosmopolitan/bin/cosmocc -o gpu_cfg_gen gpu_cfg_generator.c
9+
$(COSMOCC)/bin/cosmocc -o gpu_cfg_gen gpu_cfg_generator.c
810

911
native: gpu_cfg_generator.c gpu_cfg_generator.h
1012
$(CC) -o gpu_cfg_gen gpu_cfg_generator.c -Wall

0 commit comments

Comments
 (0)