Skip to content

Commit

Permalink
Github actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
bhperry committed Sep 18, 2024
1 parent 6c53693 commit 993c1ac
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: continuous integration
on: push

jobs:
cancel-previous:
name: Cancel previous runs
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
lint:
name: Go lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Vet
run: go vet ./...
- name: Linter
run: golint ./...
test:
name: Tests
runs-on: ubunto-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Run tests
run: make test
runs-complete:
name: Lint and test
needs: [lint, test]
if: always()
runs-on: ubuntu-latest
steps:
- if: ${{ needs['lint'].result != 'success' || needs['test'].result != 'success' }}
name: Fail
run: exit 1
- name: Tests complete
run: echo "Tests complete"

0 comments on commit 993c1ac

Please sign in to comment.