From 64a28004fa3411434cbc20d71d12d454920b81de Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Mon, 14 Oct 2024 15:45:29 +0000 Subject: [PATCH 1/5] ci: simplify pr check steps Signed-off-by: Michael Beemer --- .github/workflows/pr-checks.yml | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 2616f47af..d11816f73 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -9,9 +9,6 @@ on: pull_request: paths-ignore: - '**.md' -env: - # Default minimum version of Go to support. - DEFAULT_GO_VERSION: "~1.21" permissions: contents: read @@ -24,7 +21,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: ${{ env.DEFAULT_GO_VERSION }} + go-version-file: 'go.mod' - name: Setup Environment run: | @@ -62,25 +59,25 @@ jobs: uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@master + uses: docker/setup-qemu-action@v3 with: platforms: all - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@master + uses: docker/setup-buildx-action@v3 - name: Build uses: docker/build-push-action@v4 with: builder: ${{ steps.buildx.outputs.name }} context: . - outputs: type=docker,dest=${{ github.workspace }}/open-feature-operator-local.tar + push: false tags: open-feature-operator-local:${{ github.sha }} cache-from: type=gha,scope=${{ github.ref_name }}-ofo cache-to: type=gha,scope=${{ github.ref_name }}-ofo - name: Run Trivy vulnerability scanner - uses: aquasecurity/trivy-action@master + uses: aquasecurity/trivy-action@0.27.0 with: - input: /github/workspace/open-feature-operator-local.tar + image-ref: open-feature-operator-local:${{ github.sha }} format: "template" template: "@/contrib/sarif.tpl" output: "trivy-results.sarif" @@ -89,11 +86,6 @@ jobs: uses: github/codeql-action/upload-sarif@v2 with: sarif_file: "trivy-results.sarif" - - name: Upload image as artifact - uses: actions/upload-artifact@v3 - with: - name: open-feature-operator-local-${{ github.sha }} - path: ${{ github.workspace }}/open-feature-operator-local.tar e2e_tests: name: E2E Tests From f2b050ab6bdeee2da1d50305e5f8bab53c958009 Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Mon, 14 Oct 2024 15:45:50 +0000 Subject: [PATCH 2/5] ci: fix pr lint script Signed-off-by: Michael Beemer --- .github/workflows/pr-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 1d532ea33..e701cfa10 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -21,6 +21,7 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: amannn/action-semantic-pull-request@v5 + id: lint_pr_title env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a915078221f02bbb36a29afee8e7ec28eb9fd37f Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Mon, 14 Oct 2024 15:48:36 +0000 Subject: [PATCH 3/5] checkout first Signed-off-by: Michael Beemer --- .github/workflows/pr-checks.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index d11816f73..b8ce78542 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -18,6 +18,9 @@ jobs: name: Unit Tests runs-on: ubuntu-22.04 steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Go uses: actions/setup-go@v5 with: @@ -36,9 +39,6 @@ jobs: path: ~/go/pkg/mod key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} - - name: Checkout repository - uses: actions/checkout@v4 - - name: Workspace Init run: make workspace-init From e3f5c03e9460d07c67ab8bc92b53ba754865e63e Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Mon, 14 Oct 2024 15:57:30 +0000 Subject: [PATCH 4/5] set the output to type docker Signed-off-by: Michael Beemer --- .github/workflows/pr-checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index b8ce78542..ad385f9f7 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -71,6 +71,7 @@ jobs: builder: ${{ steps.buildx.outputs.name }} context: . push: false + load: true tags: open-feature-operator-local:${{ github.sha }} cache-from: type=gha,scope=${{ github.ref_name }}-ofo cache-to: type=gha,scope=${{ github.ref_name }}-ofo From 5cd878d98c383408166a5099fc4f2c2950f2fdcc Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Mon, 14 Oct 2024 16:09:27 +0000 Subject: [PATCH 5/5] revert to tar, bump versions Signed-off-by: Michael Beemer --- .github/workflows/e2e.yml | 2 +- .github/workflows/pr-checks.yml | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 036165de8..b23fd55c0 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 - name: Download image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: open-feature-operator-local-${{ github.sha }} path: ${{ github.workspace }} diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index ad385f9f7..23f25c225 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -70,15 +70,14 @@ jobs: with: builder: ${{ steps.buildx.outputs.name }} context: . - push: false - load: true + outputs: type=docker,dest=${{ github.workspace }}/open-feature-operator-local.tar tags: open-feature-operator-local:${{ github.sha }} cache-from: type=gha,scope=${{ github.ref_name }}-ofo cache-to: type=gha,scope=${{ github.ref_name }}-ofo - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@0.27.0 with: - image-ref: open-feature-operator-local:${{ github.sha }} + input: ${{ github.workspace }}/open-feature-operator-local.tar format: "template" template: "@/contrib/sarif.tpl" output: "trivy-results.sarif" @@ -87,6 +86,11 @@ jobs: uses: github/codeql-action/upload-sarif@v2 with: sarif_file: "trivy-results.sarif" + - name: Upload image as artifact + uses: actions/upload-artifact@v4 + with: + name: open-feature-operator-local-${{ github.sha }} + path: ${{ github.workspace }}/open-feature-operator-local.tar e2e_tests: name: E2E Tests