test-backend.yml 792 B

123456789101112131415161718192021222324252627282930
  1. name: Backend CI
  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. - name: Run Go vet
  28. run: go vet ./${{ matrix.folder }}/...
  29. - name: Run Go tests
  30. run: go test ./${{ matrix.folder }}/...