diff --git a/.github/workflows/nob.yaml b/.github/workflows/nob.yaml new file mode 100644 index 0000000..a0929da --- /dev/null +++ b/.github/workflows/nob.yaml @@ -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/ +