pr_push_checks.yaml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. name: PR Checks
  2. on:
  3. - pull_request
  4. jobs:
  5. testing_matrix:
  6. strategy:
  7. matrix:
  8. os: [ubuntu-latest]
  9. folder: [cli, api, cmd, internal, provisioner]
  10. name: Running Go Tests
  11. runs-on: ${{ matrix.os }}
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Setup Go Cache
  15. uses: actions/cache@v3
  16. with:
  17. path: |
  18. ~/.cache/go-build
  19. ~/go/pkg/mod
  20. key: porter-go-${{ hashFiles('**/go.sum') }}
  21. - name: Download Go Modules
  22. run: go mod download
  23. - uses: actions/setup-go@v4
  24. with:
  25. go-version-file: go.mod
  26. cache: false
  27. go-version: '1.20.5'
  28. - name: Run Go vet
  29. run: go vet ./${{ matrix.folder }}/...
  30. - name: Run Go tests
  31. run: go test ./${{ matrix.folder }}/...
  32. build-npm:
  33. name: Running smoke test npm build
  34. runs-on: ubuntu-latest
  35. steps:
  36. - name: Checkout code
  37. uses: actions/checkout@v3
  38. - name: Setup Node
  39. uses: actions/setup-node@v3
  40. with:
  41. node-version: 16
  42. - name: Setup NPM
  43. working-directory: dashboard
  44. run: |
  45. # installing updated npm
  46. # Verify npm works before capturing and ensure its stderr is inspectable later
  47. version="$(jq -r '.engines.npm' package.json)"
  48. npm --version 2>&1 1>/dev/null
  49. npm_version="$(npm --version)"
  50. echo "Bootstrapping npm $version (replacing $npm_version)..."
  51. npm install --unsafe-perm -g --quiet "npm@$version"
  52. # Verify npm works before capturing and ensure its stderr is inspectable later
  53. npm --version 2>&1 1>/dev/null
  54. echo "npm $(npm --version) installed"
  55. - name: Install NPM Dependencies
  56. working-directory: dashboard
  57. run: |
  58. npm i --legacy-peer-deps
  59. - name: Run NPM Build
  60. working-directory: dashboard
  61. run: |
  62. npm run build