test.yaml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. name: test
  2. on: [push, pull_request]
  3. jobs:
  4. test:
  5. runs-on: ubuntu-latest
  6. steps:
  7. -
  8. name: Install Go
  9. uses: actions/setup-go@v2
  10. with:
  11. go-version: '1.19.x'
  12. -
  13. name: Install node
  14. uses: actions/setup-node@v2
  15. with:
  16. node-version: '17'
  17. -
  18. name: Checkout code
  19. uses: actions/checkout@v2
  20. -
  21. name: Cache Go and npm modules
  22. uses: actions/cache@v3
  23. with:
  24. path: |
  25. ~/go/pkg/mod
  26. ~/go/bin
  27. ~/.npm
  28. web/node_modules
  29. key: ${{ runner.os }}-ntfy-${{ hashFiles('**/go.sum', '**/package.lock') }}
  30. restore-keys: ${{ runner.os }}-ntfy-
  31. -
  32. name: Install dependencies
  33. run: make build-deps-ubuntu
  34. -
  35. name: Build docs (required for tests)
  36. run: make docs
  37. -
  38. name: Build web app (required for tests)
  39. run: make web
  40. -
  41. name: Run tests, formatting, vetting and linting
  42. run: make check
  43. -
  44. name: Run coverage
  45. run: make coverage
  46. -
  47. name: Upload coverage to codecov.io
  48. run: make coverage-upload