Skip to content

Commit

Permalink
Create CI build script
Browse files Browse the repository at this point in the history
  • Loading branch information
bullno1 committed Nov 2, 2024
1 parent d1406e6 commit 11bc807
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build
run-name: Build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
- push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install deps
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libx11-dev libgl-dev libxcursor-dev libxi-dev
version: "@latest"
- name: Download cosmopolitan
uses: bjia56/setup-cosmocc@main
with:
version: "3.9.6"
- name: Build
run: ./build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.head_ref || github.ref_name }}
path: bin/*
9 changes: 8 additions & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ compile shims/linux/x11.c ${LINUX_FLAGS}

compile main.c ${FLAGS}

cat .build/commands | parallel --bar --max-procs $(nproc)
if [ -t 1 ]
then
PARALLEL_FLAGS="--bar"
else
PARALLEL_FLAGS="--progress"
fi

cat .build/commands | parallel $PARALLEL_FLAGS --max-procs $(nproc)

objects=$(find .build -name '*.o' -not -path '*.aarch64/*')
cosmoc++ ${FLAGS} -o bin/cosmo-sokol $objects

0 comments on commit 11bc807

Please sign in to comment.