Skip to content

Commit

Permalink
Move workflows up from steps
Browse files Browse the repository at this point in the history
Signed-off-by: John Kjell <[email protected]>
  • Loading branch information
jkjell committed Oct 26, 2023
1 parent 7a39590 commit 93ef787
Showing 1 changed file with 32 additions and 33 deletions.
65 changes: 32 additions & 33 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,13 @@ on:
- main
pull_request:
jobs:
test:
strategy:
matrix:
go-version: [ 1.21.x ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
ready:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
go-version: 1.21.x

- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -50,34 +46,37 @@ jobs:
run: test -z $(go fmt ./...)
- name: Install GoKart
run: go install github.com/praetorian-inc/gokart@latest

- name: Static Analysis
uses: ./.github/workflows/witness.yml
with:
pull_request: ${{ github.event_name == 'pull_request' }}
step: static-analysis
attestations: "github sarif"
command: gokart scan . -o sarif-results.json -s

- name: Test
uses: ./.github/workflows/witness.yml
with:
pull_request: ${{ github.event_name == 'pull_request' }}
step: "test"
attestations: "github"
command: go test -v -coverprofile=profile.cov -covermode=atomic ./...

- name: E2E Tests
uses: ./.github/workflows/witness.yml
with:
pull_request: ${{ github.event_name == 'pull_request' }}
step: "e2e"
attestations: "github"
command: ./test/test.sh

- name: Send coverage
- name: Coverage Report
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GO111MODULE=off go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
static_analysis:
needs: ready
uses: ./.github/workflows/witness.yml
with:
pull_request: ${{ github.event_name == 'pull_request' }}
step: static-analysis
attestations: "github sarif"
command: gokart scan . -o sarif-results.json -s

test:
needs: ready
uses: ./.github/workflows/witness.yml
with:
pull_request: ${{ github.event_name == 'pull_request' }}
step: "test"
attestations: "github"
command: go test -v -coverprofile=profile.cov -covermode=atomic ./...

e2e-tests:
needs: ready
uses: ./.github/workflows/witness.yml
with:
pull_request: ${{ github.event_name == 'pull_request' }}
step: "e2e"
attestations: "github"
command: ./test/test.sh

0 comments on commit 93ef787

Please sign in to comment.