-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from m4c0/master
Add Github workflow
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: no-build build | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
macos: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Clone GIT repo | ||
uses: actions/checkout@v4 | ||
- name: Build nob | ||
run: clang -o nob nob.c | ||
- name: Run nob | ||
run: ./nob | ||
- name: Upload build folder | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: macos-build-folder | ||
path: build/ | ||
ubuntu: | ||
strategy: | ||
matrix: | ||
cc: [gcc, clang] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone GIT repo | ||
uses: actions/checkout@v4 | ||
- name: Pull Deps | ||
run: sudo apt install xorg-dev | ||
- name: Build nob | ||
run: ${{ matrix.cc }} -o nob nob.c | ||
- name: Run nob | ||
run: ./nob | ||
- name: Upload build folder | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ubuntu-${{ matrix.cc }}-build-folder | ||
path: build/ | ||
windows: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Clone GIT repo | ||
uses: actions/checkout@v4 | ||
- name: Build nob | ||
shell: cmd | ||
# cl.exe isn't available as-is in Github images because they don't want | ||
# to, so we need to pull env vars ourselves. Refs: | ||
# https://github.com/actions/runner-images/issues/6205#issuecomment-1241573412 | ||
# https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#create-your-own-command-prompt-shortcut | ||
run: | | ||
call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" | ||
cl.exe -o nob.exe nob.c | ||
- name: Run nob | ||
shell: cmd | ||
run: nob.exe | ||
- name: Upload build folder | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: windows-build-folder | ||
path: build/ | ||
|