integration_tests.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. on:
  2. workflow_run:
  3. workflows: ["Deploy Porter to Internal Tooling"]
  4. branches: [master]
  5. types:
  6. - completed
  7. name: Run integration tests
  8. jobs:
  9. build-linux:
  10. name: Build Linux binaries
  11. runs-on: ubuntu-latest
  12. if: ${{ github.event.workflow_run.conclusion == 'success' }}
  13. steps:
  14. - name: Checkout code
  15. uses: actions/checkout@v3
  16. - name: Set up Go
  17. uses: actions/setup-go@v4
  18. with:
  19. cache: false
  20. go-version: "1.20.5"
  21. go-version-file: go.mod
  22. - name: Build Linux binaries
  23. run: |
  24. go build -ldflags="-w -s -X 'github.com/porter-dev/porter/cli/cmd/config.Version=dev_${{ github.sha }}' -X 'github.com/porter-dev/porter/cli/cmd/errors.SentryDSN=${{secrets.SENTRY_DSN}}'" -a -tags cli -o ./porter ./cli &
  25. wait
  26. env:
  27. GOOS: linux
  28. GOARCH: amd64
  29. CGO_ENABLED: 0
  30. - name: Zip Linux binaries
  31. run: |
  32. mkdir -p ./release/linux
  33. zip --junk-paths ./release/linux/porter_dev_${{ github.sha }}_Linux_x86_64.zip ./porter
  34. - name: Upload binaries
  35. uses: actions/upload-artifact@v3
  36. with:
  37. name: go-binaries-cli
  38. path: bin/
  39. retention-days: 1
  40. run-integration-tests:
  41. name: run integration tests to test new build
  42. runs-on: ubuntu-latest
  43. needs: build-linux
  44. steps:
  45. - name: Get built CLI
  46. uses: actions/download-artifact@v3
  47. with:
  48. name: go-binaries-cli
  49. path: bin/
  50. - name: Porter app run
  51. run: bin/porter app run app-integration-tests --job trigger
  52. env:
  53. PORTER_CLUSTER: "142"
  54. PORTER_HOST: https://dashboard.internal-tools.porter.run
  55. PORTER_PROJECT: "301"
  56. PORTER_TOKEN: ${{ secrets.APP_INTEGRATION_PROJECT_TOKEN }}
  57. PORTER_SERVICE: porter
  58. PORTER_COMMIT: ${{ github.sha }}