Skip to content

Commit

Permalink
Merge pull request #225 from ColinChamber/add-ci-yaml
Browse files Browse the repository at this point in the history
add ci workflow
  • Loading branch information
childe authored Jul 29, 2023
2 parents d16136d + 12d91a7 commit ca59799
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
69 changes: 69 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI Actions # don't edit while the badge was depend on this

on:
push:
branches:
- 'master'
pull_request:
branches:
- 'master'

jobs:
lint-build-test:
name: Build/Lint/Test
strategy:
matrix:
go-version: [1.19.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{matrix.go-version}}

- name: Checkout Code Base
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Restore Go Module Cache
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Build
run: make

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53
continue-on-error: true

- name: Test
run: make test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
flags: unittests
name: codecov-umbrella
verbose: true

check-docker:
name: Check Docker image
needs: [lint-build-test]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: docker/build-push-action@v3
with:
context: .
push: false
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ check:
git diff-index --quiet HEAD --

test:
go test -v ./...
go test -v ./... -covermode=atomic -coverprofile=coverage.out

0 comments on commit ca59799

Please sign in to comment.