From d4fa0ab74eab793aaf8a8fa3fd69f089943cbc82 Mon Sep 17 00:00:00 2001 From: schristoff <28318173+schristoff@users.noreply.github.com> Date: Fri, 18 Aug 2023 20:50:03 -0600 Subject: [PATCH 01/13] Add workflow porter/porter --- .github/workflows/porter.yml | 248 +++++++++++++++++++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100644 .github/workflows/porter.yml diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml new file mode 100644 index 000000000..053b16245 --- /dev/null +++ b/.github/workflows/porter.yml @@ -0,0 +1,248 @@ +name: porter/porter +on: + pull_request: + branches: + - main +env: + GOCACHE: "${{ runner.workspace }}/.cache/go-build/" + GOCACHE_KEY: v3 | go-build | "${{ runner.os }}" | go.sum + GOCACHE_RESTOREKEYS: | + v3 | go-build | "${{ runner.os }}" + v3 | go-build | "${{ runner.os }}" | go.sum + GOMODCACHE: "/home/vsts/go/pkg/mod" + GOMODCACHE_KEY: v4 | go-pkg | "${{ runner.os }}" | go.sum + GOMODCACHE_RESTOREKEYS: | + v4 | go-pkg | "${{ runner.os }}" + v4 | go-pkg | "${{ runner.os }}" | go.sum + GOVERSION: 1.20.7 + GOXCACHE_KEY: v3 | go-xbuild | "${{ runner.os }}" | go.sum + GOXCACHE_RESTOREKEYS: | + v3 | go-xbuild | "${{ runner.os }}" + v3 | go-xbuild | "${{ runner.os }}" | go.sum +jobs: + Setup-pr_type: + name: Determine PR Type + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3.5.0 + - name: Is Doc Only? + id: BUILD + run: "./build/doc-only-build.sh" + shell: bash + Validate-build: + name: Native Compile + needs: + - Setup-pr_type + runs-on: ubuntu-latest + if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' + steps: + - name: checkout + uses: actions/checkout@v3.5.0 +# # This item has no matching transformer +# - task: GoTool@0 +# displayName: Set Go Version +# inputs: +# version: "${{ env.GOVERSION }}" +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Packages +# inputs: +# key: "${{ env.GOMODCACHE_KEY }}" +# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" +# path: "${{ env.GOMODCACHE }}" +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Build +# inputs: +# key: "${{ env.GOCACHE_KEY }}" +# restoreKeys: "${{ env.GOCACHE_RESTOREKEYS }}" +# path: "${{ env.GOCACHE }}" + - name: Configure Agent + run: go run mage.go ConfigureAgent + - name: Native Build + run: mage build + shell: bash + - name: Publish Native Binaries + uses: actions/upload-artifact@v3.1.1 + with: + name: build-bin + path: "${{ github.workspace }}/bin" + Validate-xbuild: + name: Cross Compile + needs: + - Setup-pr_type + runs-on: ubuntu-latest + if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' + steps: + - name: checkout + uses: actions/checkout@v3.5.0 +# # This item has no matching transformer +# - task: GoTool@0 +# displayName: Set Go Version +# inputs: +# version: "${{ env.GOVERSION }}" +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Packages +# inputs: +# key: "${{ env.GOMODCACHE_KEY }}" +# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" +# path: "${{ env.GOMODCACHE }}" +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Build +# inputs: +# key: "${{ env.GOXCACHE_KEY }}" +# restoreKeys: "${{ env.GOXCACHE_RESTOREKEYS }}" +# path: "${{ env.GOCACHE }}" + - name: Configure Agent + run: go run mage.go ConfigureAgent + - name: Cross Compile + run: mage XBuildAll + shell: bash + - name: Publish Release Binaries + uses: actions/upload-artifact@v3.1.1 + with: + name: xbuild-bin + path: "${{ github.workspace }}/bin" + Validate-unit_test: + name: Unit Test + needs: + - Setup-pr_type + runs-on: ubuntu-latest + if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' + steps: + - name: checkout + uses: actions/checkout@v3.5.0 +# # This item has no matching transformer +# - task: GoTool@0 +# displayName: Set Go Version +# inputs: +# version: "${{ env.GOVERSION }}" +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Packages +# inputs: +# key: "${{ env.GOMODCACHE_KEY }}" +# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" +# path: "${{ env.GOMODCACHE }}" +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Build +# inputs: +# key: "${{ env.GOCACHE_KEY }}" +# restoreKeys: "${{ env.GOCACHE_RESTOREKEYS }}" +# path: "${{ env.GOCACHE }}" + - name: Configure Agent + run: go run mage.go ConfigureAgent + - name: Unit Test + run: mage TestUnit + shell: bash + Validate-VetLint: + name: Vet and Lint + needs: + - Setup-pr_type + runs-on: ubuntu-latest + if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' + steps: + - name: checkout + uses: actions/checkout@v3.5.0 +# # This item has no matching transformer +# - task: GoTool@0 +# displayName: Set Go Version +# inputs: +# version: "${{ env.GOVERSION }}" +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Packages +# inputs: +# key: "${{ env.GOMODCACHE_KEY }}" +# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" +# path: "${{ env.GOMODCACHE }}" +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Build +# inputs: +# key: "${{ env.GOCACHE_KEY }}" +# restoreKeys: "${{ env.GOCACHE_RESTOREKEYS }}" +# path: "${{ env.GOCACHE }}" + - name: Configure Agent + run: go run mage.go ConfigureAgent + - name: Vet + run: mage Vet + shell: bash + - name: Lint + run: mage Lint + shell: bash + Validate-build_docker: + needs: + - Validate-xbuild + - Setup-pr_type + runs-on: ubuntu-latest + if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' + steps: + - name: checkout + uses: actions/checkout@v3.5.0 +# # This item has no matching transformer +# - task: GoTool@0 +# displayName: Set Go Version +# inputs: +# version: "${{ env.GOVERSION }}" + - name: Download Cross-Compiled Porter Binaries + uses: actions/download-artifact@v3.0.1 + with: + name: xbuild-bin + path: bin + - name: Setup Bin + run: go run mage.go ConfigureAgent UseXBuildBinaries + - name: Build Docker Images + run: mage BuildImages + Validate-smoke_test: + name: Run smoke tests on + needs: + - Validate-xbuild + - Setup-pr_type + runs-on: + - self-hosted + - "${{ matrix.vmImage }}" + if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' + strategy: + matrix: + include: + - poolName: Azure Pipelines + vmImage: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3.5.0 + - name: Download Cross-Compiled Porter Binaries + uses: actions/download-artifact@v3.0.1 + with: + name: xbuild-bin + path: bin +# # This item has no matching transformer +# - task: GoTool@0 +# displayName: Set Go Version +# inputs: +# version: "${{ env.GOVERSION }}" + - name: Windows Cache Prep + if: env.poolName == 'windows' + run: attrib -r ${{ env.GOMODCACHE }}/*.* /s +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Packages +# inputs: +# key: "${{ env.GOMODCACHE_KEY }}" +# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" +# path: "${{ env.GOMODCACHE }}" +# # This item has no matching transformer +# - task: Cache@2 +# displayName: Cache Go Build +# inputs: +# key: "${{ env.GOCACHE_KEY }}" +# restoreKeys: "${{ env.GOCACHE_RESTOREKEYS }}" +# path: "${{ env.GOCACHE }}" + - name: Configure Agent + run: go run mage.go ConfigureAgent UseXBuildBinaries + - name: Run Smoke Tests + run: mage -v TestSmoke From 9a2e6fd6e347b86ed7c18d614b09289406c15f20 Mon Sep 17 00:00:00 2001 From: schristoff <28318173+schristoff@users.noreply.github.com> Date: Fri, 18 Aug 2023 21:01:37 -0600 Subject: [PATCH 02/13] update go install, runners have cache on by default Signed-off-by: schristoff <28318173+schristoff@users.noreply.github.com> --- .github/workflows/porter.yml | 124 +++++++---------------------------- 1 file changed, 24 insertions(+), 100 deletions(-) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index 053b16245..f48c0764b 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -39,25 +39,10 @@ jobs: steps: - name: checkout uses: actions/checkout@v3.5.0 -# # This item has no matching transformer -# - task: GoTool@0 -# displayName: Set Go Version -# inputs: -# version: "${{ env.GOVERSION }}" -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Packages -# inputs: -# key: "${{ env.GOMODCACHE_KEY }}" -# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" -# path: "${{ env.GOMODCACHE }}" -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Build -# inputs: -# key: "${{ env.GOCACHE_KEY }}" -# restoreKeys: "${{ env.GOCACHE_RESTOREKEYS }}" -# path: "${{ env.GOCACHE }}" + - uses: actions/setup-go@v4 + with: + go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. + - run: go version - name: Configure Agent run: go run mage.go ConfigureAgent - name: Native Build @@ -77,25 +62,10 @@ jobs: steps: - name: checkout uses: actions/checkout@v3.5.0 -# # This item has no matching transformer -# - task: GoTool@0 -# displayName: Set Go Version -# inputs: -# version: "${{ env.GOVERSION }}" -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Packages -# inputs: -# key: "${{ env.GOMODCACHE_KEY }}" -# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" -# path: "${{ env.GOMODCACHE }}" -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Build -# inputs: -# key: "${{ env.GOXCACHE_KEY }}" -# restoreKeys: "${{ env.GOXCACHE_RESTOREKEYS }}" -# path: "${{ env.GOCACHE }}" + - uses: actions/setup-go@v4 + with: + go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. + - run: go version - name: Configure Agent run: go run mage.go ConfigureAgent - name: Cross Compile @@ -115,25 +85,10 @@ jobs: steps: - name: checkout uses: actions/checkout@v3.5.0 -# # This item has no matching transformer -# - task: GoTool@0 -# displayName: Set Go Version -# inputs: -# version: "${{ env.GOVERSION }}" -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Packages -# inputs: -# key: "${{ env.GOMODCACHE_KEY }}" -# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" -# path: "${{ env.GOMODCACHE }}" -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Build -# inputs: -# key: "${{ env.GOCACHE_KEY }}" -# restoreKeys: "${{ env.GOCACHE_RESTOREKEYS }}" -# path: "${{ env.GOCACHE }}" + - uses: actions/setup-go@v4 + with: + go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. + - run: go version - name: Configure Agent run: go run mage.go ConfigureAgent - name: Unit Test @@ -148,25 +103,10 @@ jobs: steps: - name: checkout uses: actions/checkout@v3.5.0 -# # This item has no matching transformer -# - task: GoTool@0 -# displayName: Set Go Version -# inputs: -# version: "${{ env.GOVERSION }}" -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Packages -# inputs: -# key: "${{ env.GOMODCACHE_KEY }}" -# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" -# path: "${{ env.GOMODCACHE }}" -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Build -# inputs: -# key: "${{ env.GOCACHE_KEY }}" -# restoreKeys: "${{ env.GOCACHE_RESTOREKEYS }}" -# path: "${{ env.GOCACHE }}" + - uses: actions/setup-go@v4 + with: + go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. + - run: go version - name: Configure Agent run: go run mage.go ConfigureAgent - name: Vet @@ -184,11 +124,10 @@ jobs: steps: - name: checkout uses: actions/checkout@v3.5.0 -# # This item has no matching transformer -# - task: GoTool@0 -# displayName: Set Go Version -# inputs: -# version: "${{ env.GOVERSION }}" + - uses: actions/setup-go@v4 + with: + go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. + - run: go version - name: Download Cross-Compiled Porter Binaries uses: actions/download-artifact@v3.0.1 with: @@ -220,28 +159,13 @@ jobs: with: name: xbuild-bin path: bin -# # This item has no matching transformer -# - task: GoTool@0 -# displayName: Set Go Version -# inputs: -# version: "${{ env.GOVERSION }}" + - uses: actions/setup-go@v4 + with: + go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. + - run: go version - name: Windows Cache Prep if: env.poolName == 'windows' run: attrib -r ${{ env.GOMODCACHE }}/*.* /s -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Packages -# inputs: -# key: "${{ env.GOMODCACHE_KEY }}" -# restoreKeys: "${{ env.GOMODCACHE_RESTOREKEYS }}" -# path: "${{ env.GOMODCACHE }}" -# # This item has no matching transformer -# - task: Cache@2 -# displayName: Cache Go Build -# inputs: -# key: "${{ env.GOCACHE_KEY }}" -# restoreKeys: "${{ env.GOCACHE_RESTOREKEYS }}" -# path: "${{ env.GOCACHE }}" - name: Configure Agent run: go run mage.go ConfigureAgent UseXBuildBinaries - name: Run Smoke Tests From beaac14781e1bfcac94d4ff5dde3c8d28c17339b Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Wed, 30 Aug 2023 15:44:56 -0700 Subject: [PATCH 03/13] fix yaml error Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index f48c0764b..7a6dd718a 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -4,7 +4,7 @@ on: branches: - main env: - GOCACHE: "${{ runner.workspace }}/.cache/go-build/" + GOCACHE: "${{ github.workspace }}/.cache/go-build/" GOCACHE_KEY: v3 | go-build | "${{ runner.os }}" | go.sum GOCACHE_RESTOREKEYS: | v3 | go-build | "${{ runner.os }}" From edfdbb92e22052e5b2128b32060d829851edbb4e Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Wed, 30 Aug 2023 16:10:41 -0700 Subject: [PATCH 04/13] remove caching Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter.yml | 63 +++++++++++++----------------------- 1 file changed, 23 insertions(+), 40 deletions(-) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index 7a6dd718a..5869fc587 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -4,23 +4,10 @@ on: branches: - main env: - GOCACHE: "${{ github.workspace }}/.cache/go-build/" - GOCACHE_KEY: v3 | go-build | "${{ runner.os }}" | go.sum - GOCACHE_RESTOREKEYS: | - v3 | go-build | "${{ runner.os }}" - v3 | go-build | "${{ runner.os }}" | go.sum - GOMODCACHE: "/home/vsts/go/pkg/mod" - GOMODCACHE_KEY: v4 | go-pkg | "${{ runner.os }}" | go.sum - GOMODCACHE_RESTOREKEYS: | - v4 | go-pkg | "${{ runner.os }}" - v4 | go-pkg | "${{ runner.os }}" | go.sum GOVERSION: 1.20.7 - GOXCACHE_KEY: v3 | go-xbuild | "${{ runner.os }}" | go.sum - GOXCACHE_RESTOREKEYS: | - v3 | go-xbuild | "${{ runner.os }}" - v3 | go-xbuild | "${{ runner.os }}" | go.sum + jobs: - Setup-pr_type: + PR_type: name: Determine PR Type runs-on: ubuntu-latest steps: @@ -30,10 +17,11 @@ jobs: id: BUILD run: "./build/doc-only-build.sh" shell: bash - Validate-build: + + Build: name: Native Compile needs: - - Setup-pr_type + - PR_type runs-on: ubuntu-latest if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' steps: @@ -53,10 +41,11 @@ jobs: with: name: build-bin path: "${{ github.workspace }}/bin" - Validate-xbuild: + + XBuild: name: Cross Compile needs: - - Setup-pr_type + - PR_type runs-on: ubuntu-latest if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' steps: @@ -76,10 +65,11 @@ jobs: with: name: xbuild-bin path: "${{ github.workspace }}/bin" - Validate-unit_test: + + Unit_test: name: Unit Test needs: - - Setup-pr_type + - PR_type runs-on: ubuntu-latest if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' steps: @@ -94,10 +84,11 @@ jobs: - name: Unit Test run: mage TestUnit shell: bash - Validate-VetLint: + + VetLint: name: Vet and Lint needs: - - Setup-pr_type + - PR_type runs-on: ubuntu-latest if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' steps: @@ -115,10 +106,11 @@ jobs: - name: Lint run: mage Lint shell: bash - Validate-build_docker: + + Build-docker-images: needs: - - Validate-xbuild - - Setup-pr_type + - PR_type + - XBuild runs-on: ubuntu-latest if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' steps: @@ -137,20 +129,14 @@ jobs: run: go run mage.go ConfigureAgent UseXBuildBinaries - name: Build Docker Images run: mage BuildImages - Validate-smoke_test: + + Smoke-test: name: Run smoke tests on needs: - - Validate-xbuild - - Setup-pr_type - runs-on: - - self-hosted - - "${{ matrix.vmImage }}" + - PR_type + - XBuild + runs-on: ubuntu-latest if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' - strategy: - matrix: - include: - - poolName: Azure Pipelines - vmImage: ubuntu-latest steps: - name: checkout uses: actions/checkout@v3.5.0 @@ -163,9 +149,6 @@ jobs: with: go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. - run: go version - - name: Windows Cache Prep - if: env.poolName == 'windows' - run: attrib -r ${{ env.GOMODCACHE }}/*.* /s - name: Configure Agent run: go run mage.go ConfigureAgent UseXBuildBinaries - name: Run Smoke Tests From 12e8297261dab90e18a14829b3a479560886c921 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Wed, 30 Aug 2023 16:26:03 -0700 Subject: [PATCH 05/13] fixed doc-type pr Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter.yml | 37 +++++++----------------------------- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index 5869fc587..62689fab1 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -3,27 +3,15 @@ on: pull_request: branches: - main + paths-ignore: + - 'docs/**' env: GOVERSION: 1.20.7 jobs: - PR_type: - name: Determine PR Type - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3.5.0 - - name: Is Doc Only? - id: BUILD - run: "./build/doc-only-build.sh" - shell: bash - Build: name: Native Compile - needs: - - PR_type runs-on: ubuntu-latest - if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' steps: - name: checkout uses: actions/checkout@v3.5.0 @@ -44,10 +32,7 @@ jobs: XBuild: name: Cross Compile - needs: - - PR_type runs-on: ubuntu-latest - if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' steps: - name: checkout uses: actions/checkout@v3.5.0 @@ -68,10 +53,9 @@ jobs: Unit_test: name: Unit Test - needs: - - PR_type runs-on: ubuntu-latest - if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' + needs: + - Build steps: - name: checkout uses: actions/checkout@v3.5.0 @@ -87,10 +71,7 @@ jobs: VetLint: name: Vet and Lint - needs: - - PR_type runs-on: ubuntu-latest - if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' steps: - name: checkout uses: actions/checkout@v3.5.0 @@ -108,11 +89,11 @@ jobs: shell: bash Build-docker-images: + name: Build Docker Images needs: - - PR_type - XBuild runs-on: ubuntu-latest - if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' + if: success() steps: - name: checkout uses: actions/checkout@v3.5.0 @@ -131,12 +112,8 @@ jobs: run: mage BuildImages Smoke-test: - name: Run smoke tests on - needs: - - PR_type - - XBuild + name: Smoke Test runs-on: ubuntu-latest - if: success() && needs.Setup-pr_type.outputs['pr_type.BUILD.DOCS_ONLY'] == 'false' steps: - name: checkout uses: actions/checkout@v3.5.0 From 8d1acda886650e81ad6f913a8fcfa0e2c7539d18 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Wed, 30 Aug 2023 16:43:31 -0700 Subject: [PATCH 06/13] fixed smoketest dependency Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index 62689fab1..4cdcdc837 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -113,6 +113,8 @@ jobs: Smoke-test: name: Smoke Test + needs: + - Build runs-on: ubuntu-latest steps: - name: checkout From d9ebe5bc74474342dbc625e961c22f2658248765 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Wed, 30 Aug 2023 16:56:35 -0700 Subject: [PATCH 07/13] test unit test without dependency + fix smoke test artifact Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index 4cdcdc837..70da49a0f 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -54,8 +54,8 @@ jobs: Unit_test: name: Unit Test runs-on: ubuntu-latest - needs: - - Build +# needs: +# - Build steps: - name: checkout uses: actions/checkout@v3.5.0 @@ -122,7 +122,7 @@ jobs: - name: Download Cross-Compiled Porter Binaries uses: actions/download-artifact@v3.0.1 with: - name: xbuild-bin + name: build-bin path: bin - uses: actions/setup-go@v4 with: From 2f9fe1ee6e687411344f67ba45acc4a4fbb6e071 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Wed, 30 Aug 2023 17:06:45 -0700 Subject: [PATCH 08/13] change gofile to test cache and make add smoke dependency Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter.yml | 4 ++-- pkg/porter/lifecycle.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index 70da49a0f..cf23195c8 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -114,7 +114,7 @@ jobs: Smoke-test: name: Smoke Test needs: - - Build + - XBuild runs-on: ubuntu-latest steps: - name: checkout @@ -122,7 +122,7 @@ jobs: - name: Download Cross-Compiled Porter Binaries uses: actions/download-artifact@v3.0.1 with: - name: build-bin + name: xbuild-bin path: bin - uses: actions/setup-go@v4 with: diff --git a/pkg/porter/lifecycle.go b/pkg/porter/lifecycle.go index 7b5cc0cce..69d78a47f 100644 --- a/pkg/porter/lifecycle.go +++ b/pkg/porter/lifecycle.go @@ -294,7 +294,7 @@ func (p *Porter) BuildActionArgs(ctx context.Context, installation storage.Insta AllowDockerHostAccess: opts.AllowDockerHostAccess, PersistLogs: !opts.NoLogs, } - + // test cache return args, nil } From 818d45a8b3b91ac5a1e1b3355ae6afd182d4f77a Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Wed, 30 Aug 2023 17:22:59 -0700 Subject: [PATCH 09/13] remove configureagent Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter.yml | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index cf23195c8..da933c010 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -19,10 +19,8 @@ jobs: with: go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. - run: go version - - name: Configure Agent - run: go run mage.go ConfigureAgent - name: Native Build - run: mage build + run: go run mage.go build shell: bash - name: Publish Native Binaries uses: actions/upload-artifact@v3.1.1 @@ -40,10 +38,8 @@ jobs: with: go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. - run: go version - - name: Configure Agent - run: go run mage.go ConfigureAgent - name: Cross Compile - run: mage XBuildAll + run: go run mage.go XBuildAll shell: bash - name: Publish Release Binaries uses: actions/upload-artifact@v3.1.1 @@ -54,8 +50,6 @@ jobs: Unit_test: name: Unit Test runs-on: ubuntu-latest -# needs: -# - Build steps: - name: checkout uses: actions/checkout@v3.5.0 @@ -63,10 +57,8 @@ jobs: with: go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. - run: go version - - name: Configure Agent - run: go run mage.go ConfigureAgent - name: Unit Test - run: mage TestUnit + run: go run mage.go -v TestUnit shell: bash VetLint: @@ -79,13 +71,11 @@ jobs: with: go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. - run: go version - - name: Configure Agent - run: go run mage.go ConfigureAgent - name: Vet - run: mage Vet + run: go run mage.go Vet shell: bash - name: Lint - run: mage Lint + run: go run mage.go Lint shell: bash Build-docker-images: @@ -107,9 +97,9 @@ jobs: name: xbuild-bin path: bin - name: Setup Bin - run: go run mage.go ConfigureAgent UseXBuildBinaries + run: go run mage.go UseXBuildBinaries - name: Build Docker Images - run: mage BuildImages + run: go run mage.go BuildImages Smoke-test: name: Smoke Test @@ -128,7 +118,7 @@ jobs: with: go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. - run: go version - - name: Configure Agent - run: go run mage.go ConfigureAgent UseXBuildBinaries + - name: Setup Bin + run: go run mage.go UseXBuildBinaries - name: Run Smoke Tests - run: mage -v TestSmoke + run: go run mage.go -v TestSmoke From 109efc95d07a50ba3486bb2ddb8dffdc9083a615 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Wed, 30 Aug 2023 17:29:03 -0700 Subject: [PATCH 10/13] add -v for smokettes Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/porter.yml b/.github/workflows/porter.yml index da933c010..348c73d3f 100644 --- a/.github/workflows/porter.yml +++ b/.github/workflows/porter.yml @@ -39,7 +39,7 @@ jobs: go-version: "${{ env.GOVERSION }}" # The Go version to download (if necessary) and use. - run: go version - name: Cross Compile - run: go run mage.go XBuildAll + run: go run mage.go -v XBuildAll shell: bash - name: Publish Release Binaries uses: actions/upload-artifact@v3.1.1 From eb6fd951fc9a7b3f297caf823b2a5f1b847e8c46 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Thu, 31 Aug 2023 16:10:13 -0700 Subject: [PATCH 11/13] add integration test Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter-integration.yml | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/porter-integration.yml diff --git a/.github/workflows/porter-integration.yml b/.github/workflows/porter-integration.yml new file mode 100644 index 000000000..44af00e93 --- /dev/null +++ b/.github/workflows/porter-integration.yml @@ -0,0 +1,32 @@ +name: porter/porter-integration +on: + issue_comment: + types: [created, edited] + +env: + GOVERSION: 1.20.7 + +jobs: + Integration_test: + if: contains(github.event.comment.body, '/integration_test') + name: Integration Test + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3.6.0 + - uses: actions/setup-go@v4 + with: + go-version: "${{ env.GOVERSION }}" + # Unable to determine registry 'ghcr.io/getporter' type. The service connection was not found or the authentication type not supported. + - name: Docker Login + uses: docker/login-action@v2.2.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Native Build + run: go run mage.go Build + shell: bash + - name: Integration Test + run: go run mage.go -v TestIntegration + shell: bash From 68ff9339ab443c4b5cb459f9d620c11e46599fad Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg Date: Thu, 31 Aug 2023 16:15:08 -0700 Subject: [PATCH 12/13] change when to run Signed-off-by: Ludvig Liljenberg --- .github/workflows/porter-integration.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/porter-integration.yml b/.github/workflows/porter-integration.yml index 44af00e93..2a207136e 100644 --- a/.github/workflows/porter-integration.yml +++ b/.github/workflows/porter-integration.yml @@ -1,14 +1,21 @@ name: porter/porter-integration +# this will only run when this is on main branch apparently so use pr for now (temporary) +#on: +# issue_comment: +# types: [created, edited] on: - issue_comment: - types: [created, edited] + pull_request: + branches: + - main + paths-ignore: + - 'docs/**' env: GOVERSION: 1.20.7 jobs: Integration_test: - if: contains(github.event.comment.body, '/integration_test') +# if: contains(github.event.comment.body, '/integration_test') name: Integration Test runs-on: ubuntu-latest steps: From 904e21b62ef97ae253c4a443b00c79ba681defb4 Mon Sep 17 00:00:00 2001 From: schristoff <28318173+schristoff@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:28:04 -0700 Subject: [PATCH 13/13] Update pkg/porter/lifecycle.go Co-authored-by: Troy Connor Signed-off-by: schristoff <28318173+schristoff@users.noreply.github.com> --- pkg/porter/lifecycle.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/porter/lifecycle.go b/pkg/porter/lifecycle.go index b4f546f43..c75d48599 100644 --- a/pkg/porter/lifecycle.go +++ b/pkg/porter/lifecycle.go @@ -302,7 +302,6 @@ func (p *Porter) BuildActionArgs(ctx context.Context, installation storage.Insta AllowDockerHostAccess: opts.AllowDockerHostAccess, PersistLogs: !opts.NoLogs, } - // test cache return args, nil }