nob.yaml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. name: no-build build
  2. on: [push, pull_request]
  3. jobs:
  4. macos:
  5. runs-on: macos-latest
  6. steps:
  7. - name: Clone GIT repo
  8. uses: actions/checkout@v4
  9. - name: Build nob
  10. run: clang -o nob nob.c
  11. - name: Run nob
  12. run: ./nob
  13. - name: Upload build folder
  14. uses: actions/upload-artifact@v3
  15. with:
  16. name: macos-build-folder
  17. path: build/
  18. ubuntu:
  19. strategy:
  20. matrix:
  21. cc: [gcc, clang]
  22. runs-on: ubuntu-latest
  23. steps:
  24. - name: Clone GIT repo
  25. uses: actions/checkout@v4
  26. - name: Pull Deps
  27. run: sudo apt install xorg-dev
  28. - name: Build nob
  29. run: ${{ matrix.cc }} -o nob nob.c
  30. - name: Run nob
  31. run: ./nob
  32. - name: Upload build folder
  33. uses: actions/upload-artifact@v3
  34. with:
  35. name: ubuntu-${{ matrix.cc }}-build-folder
  36. path: build/
  37. windows:
  38. runs-on: windows-latest
  39. steps:
  40. - name: Clone GIT repo
  41. uses: actions/checkout@v4
  42. - name: Build nob
  43. shell: cmd
  44. # cl.exe isn't available as-is in Github images because they don't want
  45. # to, so we need to pull env vars ourselves. Refs:
  46. # https://github.com/actions/runner-images/issues/6205#issuecomment-1241573412
  47. # https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#create-your-own-command-prompt-shortcut
  48. run: |
  49. call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"
  50. cl.exe -o nob.exe nob.c
  51. - name: Run nob
  52. shell: cmd
  53. run: |
  54. call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat"
  55. nob.exe
  56. - name: Upload build folder
  57. uses: actions/upload-artifact@v3
  58. with:
  59. name: windows-build-folder
  60. path: build/