pr_push_checks.yaml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. name: PR Checks
  2. on:
  3. pull_request:
  4. types: [ready_for_review]
  5. jobs:
  6. testing_matrix:
  7. strategy:
  8. matrix:
  9. os: [ubuntu-latest]
  10. folder: [cli, api, cmd, internal, provisioner]
  11. name: Running Go Tests
  12. runs-on: ${{ matrix.os }}
  13. steps:
  14. - uses: actions/checkout@v3
  15. - name: Setup Go Cache
  16. uses: actions/cache@v3
  17. with:
  18. path: |
  19. ~/.cache/go-build
  20. ~/go/pkg/mod
  21. key: porter-go-${{ hashFiles('**/go.sum') }}
  22. - name: Download Go Modules
  23. run: go mod download
  24. - uses: actions/setup-go@v4
  25. with:
  26. go-version-file: go.mod
  27. cache: false
  28. - name: Run Go tests
  29. run: go test ./${{ matrix.folder }}/...
  30. linting:
  31. name: Go Linter
  32. runs-on: ubuntu-latest
  33. steps:
  34. - uses: actions/setup-go@v4
  35. with:
  36. cache: false
  37. - uses: actions/checkout@v3
  38. - name: Setup Go Cache
  39. uses: actions/cache@v3
  40. with:
  41. path: |
  42. ~/.cache/go-build
  43. ~/go/pkg/mod
  44. key: porter-go-${{ hashFiles('**/go.sum') }}
  45. restore-keys: porter-go-`
  46. - name: golangci-lint
  47. uses: golangci/golangci-lint-action@v3
  48. with:
  49. version: latest
  50. args: -c .github/golangci-lint.yaml --verbose
  51. skip-pkg-cache: true
  52. only-new-issues: true # this is needed until the following is merged: https://github.com/golangci/golangci-lint-action/issues/820
  53. build-npm:
  54. name: Running smoke test npm build
  55. runs-on: ubuntu-latest
  56. steps:
  57. - name: Checkout code
  58. uses: actions/checkout@v3
  59. - name: Setup Node
  60. uses: actions/setup-node@v3
  61. with:
  62. node-version: 16
  63. - name: Setup NPM
  64. working-directory: dashboard
  65. run: |
  66. # installing updated npm
  67. # Verify npm works before capturing and ensure its stderr is inspectable later
  68. version="$(jq -r '.engines.npm' package.json)"
  69. npm --version 2>&1 1>/dev/null
  70. npm_version="$(npm --version)"
  71. echo "Bootstrapping npm $version (replacing $npm_version)..."
  72. npm install --unsafe-perm -g --quiet "npm@$version"
  73. # Verify npm works before capturing and ensure its stderr is inspectable later
  74. npm --version 2>&1 1>/dev/null
  75. echo "npm $(npm --version) installed"
  76. - name: Install NPM Dependencies
  77. working-directory: dashboard
  78. run: |
  79. npm i --legacy-peer-deps
  80. - name: Run NPM Build
  81. working-directory: dashboard
  82. run: |
  83. npm run build