From c4778f0ed6fe95d258a6069d5a5efb97ff14a51e Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Thu, 4 May 2023 19:34:53 -0500 Subject: [PATCH 1/6] remove pr target, use pr instead --- .github/workflows/ci-badger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-badger-tests.yml b/.github/workflows/ci-badger-tests.yml index 9bf612ac4..4fe46179e 100644 --- a/.github/workflows/ci-badger-tests.yml +++ b/.github/workflows/ci-badger-tests.yml @@ -4,7 +4,7 @@ on: branches: - main - 'release/v*' - pull_request_target: + pull_request: branches: - main - 'release/v*' From c782baafe5db1ac33b36b60dcc9f01855acc6321 Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Fri, 5 May 2023 16:55:34 -0500 Subject: [PATCH 2/6] add conditional logic --- .github/workflows/ci-badger-tests.yml | 31 +++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-badger-tests.yml b/.github/workflows/ci-badger-tests.yml index 4fe46179e..69d7d1c95 100644 --- a/.github/workflows/ci-badger-tests.yml +++ b/.github/workflows/ci-badger-tests.yml @@ -4,14 +4,41 @@ on: branches: - main - 'release/v*' - pull_request: + pull_request_target: branches: - main - 'release/v*' schedule: - cron: "*/30 * * * *" jobs: + badger-tests-pr: + if: ${{ github.event_name == 'pull_request' }} + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 # checkout merge commit + with: + ref: "refs/pull/${{ github.event.number }}/merge" + - name: Get Go Version + run: | + #!/bin/bash + GOVERSION=$({ [ -f .go-version ] && cat .go-version; }) + echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GOVERSION }} + - name: Install Dependencies + run: make dependency + - name: Run Badger Tests + run: make test + - name: Install Goveralls + run: go install github.com/mattn/goveralls@latest + - name: Send Coverage Results + env: + COVERALLS_TOKEN: ${{ secrets.COVERALLSIO_TOKEN }} + run: goveralls -coverprofile=cover.out badger-tests: + if: ${{ github.event_name != 'pull_request' }} runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -33,4 +60,4 @@ jobs: - name: Send Coverage Results env: COVERALLS_TOKEN: ${{ secrets.COVERALLSIO_TOKEN }} - run: goveralls -coverprofile=cover.out + run: goveralls -coverprofile=cover.o From 22ec402258f10154a01d6bb9e0f7184fdf5cef0d Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Fri, 5 May 2023 16:57:20 -0500 Subject: [PATCH 3/6] typo --- .github/workflows/ci-badger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-badger-tests.yml b/.github/workflows/ci-badger-tests.yml index 69d7d1c95..684a1200b 100644 --- a/.github/workflows/ci-badger-tests.yml +++ b/.github/workflows/ci-badger-tests.yml @@ -60,4 +60,4 @@ jobs: - name: Send Coverage Results env: COVERALLS_TOKEN: ${{ secrets.COVERALLSIO_TOKEN }} - run: goveralls -coverprofile=cover.o + run: goveralls -coverprofile=cover.out From b8cb4f0d9ae0a44ef62a2becbe75c495f74910dd Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Fri, 5 May 2023 18:19:14 -0500 Subject: [PATCH 4/6] split into two workflows --- .../workflows/ci-badger-tests-coverage.yml | 32 +++++++++++++++++++ .github/workflows/ci-badger-tests.yml | 31 ++---------------- 2 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/ci-badger-tests-coverage.yml diff --git a/.github/workflows/ci-badger-tests-coverage.yml b/.github/workflows/ci-badger-tests-coverage.yml new file mode 100644 index 000000000..c5dccb3da --- /dev/null +++ b/.github/workflows/ci-badger-tests-coverage.yml @@ -0,0 +1,32 @@ +name: ci-badger-tests-coverage +on: + pull_request_target: + branches: + - main + - 'release/v*' +jobs: + badger-tests-coverage: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 # checkout merge commit + with: + ref: "refs/pull/${{ github.event.number }}/merge" + - name: Get Go Version + run: | + #!/bin/bash + GOVERSION=$({ [ -f .go-version ] && cat .go-version; }) + echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GOVERSION }} + - name: Install Dependencies + run: make dependency + - name: Run Badger Tests + run: make test + - name: Install Goveralls + run: go install github.com/mattn/goveralls@latest + - name: Send Coverage Results + env: + COVERALLS_TOKEN: ${{ secrets.COVERALLSIO_TOKEN }} + run: goveralls -coverprofile=cover.out diff --git a/.github/workflows/ci-badger-tests.yml b/.github/workflows/ci-badger-tests.yml index 684a1200b..df3911525 100644 --- a/.github/workflows/ci-badger-tests.yml +++ b/.github/workflows/ci-badger-tests.yml @@ -4,44 +4,17 @@ on: branches: - main - 'release/v*' - pull_request_target: + pull_request: branches: - main - 'release/v*' schedule: - cron: "*/30 * * * *" jobs: - badger-tests-pr: - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 # checkout merge commit - with: - ref: "refs/pull/${{ github.event.number }}/merge" - - name: Get Go Version - run: | - #!/bin/bash - GOVERSION=$({ [ -f .go-version ] && cat .go-version; }) - echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: ${{ env.GOVERSION }} - - name: Install Dependencies - run: make dependency - - name: Run Badger Tests - run: make test - - name: Install Goveralls - run: go install github.com/mattn/goveralls@latest - - name: Send Coverage Results - env: - COVERALLS_TOKEN: ${{ secrets.COVERALLSIO_TOKEN }} - run: goveralls -coverprofile=cover.out badger-tests: - if: ${{ github.event_name != 'pull_request' }} runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 # checkout merge commit - name: Get Go Version run: | #!/bin/bash From dfeab28f2fc6cbe19bb91c4dac08c02ed2fe9141 Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Fri, 5 May 2023 18:24:11 -0500 Subject: [PATCH 5/6] typo --- .github/workflows/ci-badger-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-badger-tests.yml b/.github/workflows/ci-badger-tests.yml index df3911525..4fe46179e 100644 --- a/.github/workflows/ci-badger-tests.yml +++ b/.github/workflows/ci-badger-tests.yml @@ -14,7 +14,7 @@ jobs: badger-tests: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 # checkout merge commit + - uses: actions/checkout@v3 - name: Get Go Version run: | #!/bin/bash From 5a3aa604f92e303d1acbf21de699bdd829c1ce70 Mon Sep 17 00:00:00 2001 From: Joshua Goldstein <92491720+joshua-goldstein@users.noreply.github.com> Date: Fri, 5 May 2023 19:03:44 -0500 Subject: [PATCH 6/6] don't report coverage in one workflow --- .github/workflows/ci-badger-tests.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci-badger-tests.yml b/.github/workflows/ci-badger-tests.yml index 4fe46179e..cf698eca3 100644 --- a/.github/workflows/ci-badger-tests.yml +++ b/.github/workflows/ci-badger-tests.yml @@ -28,9 +28,3 @@ jobs: run: make dependency - name: Run Badger Tests run: make test - - name: Install Goveralls - run: go install github.com/mattn/goveralls@latest - - name: Send Coverage Results - env: - COVERALLS_TOKEN: ${{ secrets.COVERALLSIO_TOKEN }} - run: goveralls -coverprofile=cover.out