瀏覽代碼

separate dev cli from integrations tests

Stefan McShane 2 年之前
父節點
當前提交
08071fc0bc
共有 2 個文件被更改,包括 60 次插入24 次删除
  1. 5 24
      .github/workflows/dev_cli_release.yml
  2. 55 0
      .github/workflows/integration_tests.yml

+ 5 - 24
.github/workflows/dev_cli.yml → .github/workflows/dev_cli_release.yml

@@ -1,15 +1,12 @@
 on:
-  workflow_run:
-    workflows: ["Deploy Porter to Internal Tooling"]
-    branches: [master]
-    types: 
-      - completed
-name: Release dev cli and run integration tests
+  push:
+    tags:
+      - dev
+name: Release dev cli
 jobs:
   build-linux:
     name: Build Linux binaries
     runs-on: ubuntu-latest
-    if: ${{ github.event.workflow_run.conclusion == 'success' }}
     steps:
       - name: Checkout code
         uses: actions/checkout@v3
@@ -17,7 +14,7 @@ jobs:
         uses: actions/setup-go@v4
         with:
           cache: false
-          go-version: '1.20.5'
+          go-version: "1.20.5"
           go-version-file: go.mod
       - name: Build Linux binaries
         run: |
@@ -89,19 +86,3 @@ jobs:
         run: |
           docker tag ghcr.io/porter-dev/porter/porter-cli:dev ghcr.io/porter-dev/porter/porter-cli:dev
           docker push ghcr.io/porter-dev/porter/porter-cli:dev
-  run-integration-tests:
-    name: run integration tests to test new build
-    runs-on: ubuntu-latest
-    needs: build-push-docker-cli
-    steps:   
-    - name: Porter app run
-      uses: porter-dev/porter-cli-action@v0.1.0
-      with:
-        command: app run app-integration-tests --job trigger
-      env:
-        PORTER_CLUSTER: "142"
-        PORTER_HOST: https://dashboard.internal-tools.porter.run
-        PORTER_PROJECT: "301"
-        PORTER_TOKEN: ${{ secrets.APP_INTEGRATION_PROJECT_TOKEN }}
-        PORTER_SERVICE: porter
-        PORTER_COMMIT: ${{ github.sha }}

+ 55 - 0
.github/workflows/integration_tests.yml

@@ -0,0 +1,55 @@
+on:
+  workflow_run:
+    workflows: ["Deploy Porter to Internal Tooling"]
+    branches: [master]
+    types:
+      - completed
+name: Run integration tests
+jobs:
+  build-linux:
+    name: Build Linux binaries
+    runs-on: ubuntu-latest
+    if: ${{ github.event.workflow_run.conclusion == 'success' }}
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v3
+      - name: Set up Go
+        uses: actions/setup-go@v4
+        with:
+          cache: false
+          go-version: "1.20.5"
+          go-version-file: go.mod
+      - name: Build Linux binaries
+        run: |
+          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 &
+          wait
+        env:
+          GOOS: linux
+          GOARCH: amd64
+          CGO_ENABLED: 0
+      - name: Zip Linux binaries
+        run: |
+          mkdir -p ./release/linux
+          zip --junk-paths ./release/linux/porter_dev_${{ github.sha }}_Linux_x86_64.zip ./porter
+      - name: Upload binaries
+        uses: actions/upload-artifact@v3
+        with:
+          path: ./release/linux
+          name: linux-binaries
+          retention-days: 1
+  run-integration-tests:
+    name: run integration tests to test new build
+    runs-on: ubuntu-latest
+    needs: build-linux
+    steps:
+      - name: Porter app run
+        uses: porter-dev/porter-cli-action@v0.1.0
+        with:
+          command: app run app-integration-tests --job trigger
+        env:
+          PORTER_CLUSTER: "142"
+          PORTER_HOST: https://dashboard.internal-tools.porter.run
+          PORTER_PROJECT: "301"
+          PORTER_TOKEN: ${{ secrets.APP_INTEGRATION_PROJECT_TOKEN }}
+          PORTER_SERVICE: porter
+          PORTER_COMMIT: ${{ github.sha }}