ci.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: CI
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - main
  7. permissions:
  8. contents: read
  9. jobs:
  10. go-test:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v5
  14. - uses: actions/setup-go@v6
  15. with:
  16. go-version-file: go.mod
  17. cache: true
  18. - name: Stub web/dist for go:embed
  19. run: mkdir -p web/dist && touch web/dist/.gitkeep
  20. - name: Test
  21. run: |
  22. go list ./... | grep -v '/frontend/node_modules/' > /tmp/go-packages.txt
  23. go test $(cat /tmp/go-packages.txt)
  24. govulncheck:
  25. runs-on: ubuntu-latest
  26. steps:
  27. - uses: actions/checkout@v5
  28. - uses: actions/setup-go@v6
  29. with:
  30. go-version-file: go.mod
  31. cache: true
  32. - name: Stub web/dist for go:embed
  33. run: mkdir -p web/dist && touch web/dist/.gitkeep
  34. - name: Install govulncheck
  35. run: go install golang.org/x/vuln/cmd/govulncheck@latest
  36. - name: Run govulncheck
  37. run: govulncheck ./...
  38. frontend:
  39. runs-on: ubuntu-latest
  40. steps:
  41. - uses: actions/checkout@v5
  42. - uses: actions/setup-node@v5
  43. with:
  44. node-version-file: .nvmrc
  45. cache: npm
  46. cache-dependency-path: frontend/package-lock.json
  47. - name: Install
  48. run: npm ci
  49. working-directory: frontend
  50. - name: Lint
  51. run: npm run lint
  52. working-directory: frontend
  53. - name: Build
  54. run: npm run build
  55. working-directory: frontend
  56. - name: Audit
  57. run: npm audit --audit-level=high
  58. working-directory: frontend