Skip to content

Commit

Permalink
feat: workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <[email protected]>
  • Loading branch information
caarlos0 committed Oct 20, 2022
1 parent 11128b6 commit c81bb9c
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Build

on:
push:
pull_request:

jobs:
build:
strategy:
matrix:
go-version: [~1.17, ^1]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
- run: go build -v ./...
- run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... -timeout 5m
- uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
36 changes: 36 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: examples

on:
push:
branches:
- 'main'
paths:
- '.github/workflows/examples.yml'
- './_examples/go.mod'
- './_examples/go.sum'
- './go.mod'
- './go.sum'
workflow_dispatch: {}

jobs:
tidy:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '^1'
cache: true
- shell: bash
run: |
(cd ./_examples && go mod tidy)
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "chore: go mod tidy examples"
branch: main
commit_user_name: actions-user
commit_user_email: [email protected]


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
# Dependency directories (remove the comment below to include it)
# vendor/
dist
coverage.txt

0 comments on commit c81bb9c

Please sign in to comment.