From ab2ecea2d73096c09cbbf6a31a6da2182ccc354b Mon Sep 17 00:00:00 2001 From: raffis Date: Mon, 16 Dec 2024 11:10:23 +0100 Subject: [PATCH] ci: align ci workflows (#278) --- .github/workflows/main.yaml | 7 ------- .github/workflows/pr-build.yaml | 13 ++++++------- .github/workflows/pr-nancy.yaml | 7 ------- .github/workflows/scan.yaml | 27 +++++---------------------- 4 files changed, 11 insertions(+), 43 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 3f5ce676..6cca9b4d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,13 +22,6 @@ jobs: uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: go-version: 1.20.5 - - name: Restore Go cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: Tests run: make test - name: Send go coverage report diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 2b7a16a6..27f62bf0 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -52,13 +52,6 @@ jobs: uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: go-version: 1.20.5 - - name: Restore Go cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: fmt run: make fmt - name: vet @@ -208,3 +201,9 @@ jobs: kubectl -n mongo-system get pods -o yaml kubectl -n kube-system get pods kubectl -n mongo-system logs deploy/mongodb-query-exporter + + test-success: + runs-on: ubuntu-latest + needs: [e2e-tests] + steps: + - run: echo "all tests succeeded" diff --git a/.github/workflows/pr-nancy.yaml b/.github/workflows/pr-nancy.yaml index a899b2e8..9b31dd14 100644 --- a/.github/workflows/pr-nancy.yaml +++ b/.github/workflows/pr-nancy.yaml @@ -26,13 +26,6 @@ jobs: uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: go-version: 1.20.5 - - name: Restore Go cache - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: WriteGoList run: go list -json -m all > go.list - name: Nancy SAST Scan diff --git a/.github/workflows/scan.yaml b/.github/workflows/scan.yaml index 00e4252b..0830c0c4 100644 --- a/.github/workflows/scan.yaml +++ b/.github/workflows/scan.yaml @@ -11,22 +11,6 @@ on: permissions: {} jobs: - fossa: - runs-on: ubuntu-latest - steps: - - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 - with: - egress-policy: audit - - - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 - - name: Run FOSSA scan and upload build data - uses: fossa-contrib/fossa-action@6728dc6fe9a068c648d080c33829ffbe56565023 # v2.0.0 - with: - # FOSSA Push-Only API Token - fossa-api-key: 956b9b92c5b16eeca1467cebe104f2c3 - github-token: ${{ github.token }} - codeql: runs-on: ubuntu-latest permissions: @@ -34,17 +18,16 @@ jobs: security-events: write # for codeQL to write security events steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: egress-policy: audit - - name: Checkout repository - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Initialize CodeQL - uses: github/codeql-action/init@5f18c9ab80428f9d5a42da9ab35e6d8a1b9a9bc4 #codeql-bundle-20221020 + uses: github/codeql-action/init@f0a12816612c7306b485a22cb164feb43c6df818 # codeql-bundle-20221020 with: languages: go - name: Autobuild - uses: github/codeql-action/autobuild@5f18c9ab80428f9d5a42da9ab35e6d8a1b9a9bc4 #codeql-bundle-20221020 + uses: github/codeql-action/autobuild@f0a12816612c7306b485a22cb164feb43c6df818 # codeql-bundle-20221020 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@5f18c9ab80428f9d5a42da9ab35e6d8a1b9a9bc4 #codeql-bundle-20221020 + uses: github/codeql-action/analyze@f0a12816612c7306b485a22cb164feb43c6df818 # codeql-bundle-20221020