ci.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: CI
  2. on:
  3. push:
  4. branches: [main, master]
  5. pull_request:
  6. workflow_dispatch:
  7. permissions:
  8. contents: read
  9. env:
  10. GOPROXY: https://proxy.golang.org
  11. jobs:
  12. verify:
  13. name: Build, test, and verify FreeBSD ARM64 artifacts
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Checkout
  17. uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
  18. with:
  19. fetch-depth: 0
  20. - name: Install Go
  21. uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
  22. with:
  23. go-version: '1.25.x'
  24. - name: Check formatting
  25. run: test -z "$(gofmt -l .)"
  26. - name: Run tests
  27. run: make test
  28. - name: Build native binary
  29. run: make build
  30. - name: Verify version output
  31. run: ./bin/pizzasql -version
  32. - name: Cross-compile release targets
  33. run: |
  34. make build-linux-amd64
  35. make build-freebsd-amd64
  36. make build-freebsd-arm64
  37. - name: Stage artifacts and checksums
  38. run: |
  39. version="$(make -s version)"
  40. mkdir -p dist
  41. cp bin/pizzasql "dist/pizzasql-${version}-linux-amd64"
  42. cp bin/pizzasql-freebsd-amd64 "dist/pizzasql-${version}-freebsd-amd64"
  43. cp bin/pizzasql-freebsd-arm64 "dist/pizzasql-${version}-freebsd-arm64"
  44. (cd dist && sha256sum ./* > SHA256SUMS)
  45. cat dist/SHA256SUMS
  46. - name: Upload verification artifacts
  47. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  48. with:
  49. name: pizzasql-${{ github.sha }}
  50. path: dist/
  51. retention-days: 14
  52. if-no-files-found: error