Skip to content

Commit

Permalink
add conditional logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Goldstein committed May 5, 2023
1 parent c4778f0 commit c782baa
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/ci-badger-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit c782baa

Please sign in to comment.