ci.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. name: CI
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. workflow_dispatch:
  7. permissions:
  8. contents: read
  9. jobs:
  10. verify:
  11. name: Build, test, and verify FreeBSD ARM64 artifacts
  12. runs-on: ubuntu-latest
  13. steps:
  14. - name: Checkout
  15. uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
  16. - name: Install Zig
  17. uses: mlugg/setup-zig@v2
  18. with:
  19. version: 0.15.2
  20. - name: Check formatting
  21. run: zig fmt --check *.zig
  22. - name: Run tests
  23. run: make test
  24. - name: Build native binary
  25. run: make build
  26. - name: Verify version output
  27. run: |
  28. expected="$(cat VERSION)"
  29. got="$(./bin/pizzakv -version)"
  30. echo "version output: $got"
  31. test "$got" = "PizzaKV $expected"
  32. - name: Cross-compile release targets
  33. run: |
  34. make build-amd64
  35. make build-amd64-freebsd
  36. make build-arm64-freebsd
  37. make build-amd64-static
  38. - name: Stage artifacts and checksums
  39. run: |
  40. version="$(cat VERSION)"
  41. mkdir -p dist
  42. cp bin/pizzakv "dist/pizzakv-${version}-linux-amd64"
  43. cp bin/pizzakv_amd64 "dist/pizzakv-${version}-linux-amd64-portable"
  44. cp bin/pizzakv_amd64_static "dist/pizzakv-${version}-linux-amd64-static"
  45. cp bin/pizzakv_amd64_freebsd "dist/pizzakv-${version}-freebsd-amd64"
  46. cp bin/pizzakv_arm64_freebsd "dist/pizzakv-${version}-freebsd-arm64"
  47. (cd dist && sha256sum ./* > SHA256SUMS)
  48. cat dist/SHA256SUMS
  49. - name: Upload verification artifacts
  50. uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  51. with:
  52. name: pizzakv-${{ github.sha }}
  53. path: dist/
  54. retention-days: 14
  55. if-no-files-found: error