Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
timhuynh94 committed Jul 11, 2023
1 parent 345e30e commit 8ac07e4
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 15 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container:
image: golang:1.20

steps:
- name: clone
uses: actions/checkout@v3

- name: install go
uses: actions/setup-go@v4
with:
# use version from go.mod file
go-version-file: 'go.mod'
cache: true
check-latest: true

- name: build
run: |
make build
11 changes: 9 additions & 2 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@ on:
jobs:
prerelease:
runs-on: ubuntu-latest
container:
image: golang:1.20

steps:
- name: clone
uses: actions/checkout@v3
with:
# ensures we fetch tag history for the repository
fetch-depth: 0

- name: install go
uses: actions/setup-go@v4
with:
# use version from go.mod file
go-version-file: 'go.mod'
cache: true
check-latest: true

- name: setup
run: |
# setup git tag in Actions environment
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
container:
image: golang:1.20

steps:
- name: clone
uses: actions/checkout@v3
with:
# ensures we fetch tag history for the repository
fetch-depth: 0

- name: install go
uses: actions/setup-go@v4
with:
# use version from go.mod file
go-version-file: 'go.mod'
cache: true
check-latest: true

- name: build
env:
GOOS: linux
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@ on:
jobs:
diff-review:
runs-on: ubuntu-latest
container:
image: golang:1.20

steps:
- name: clone
uses: actions/checkout@v3

- name: install go
uses: actions/setup-go@v4
with:
# use version from go.mod file
go-version-file: 'go.mod'
cache: true
check-latest: true

- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
Expand All @@ -26,12 +33,19 @@ jobs:

full-review:
runs-on: ubuntu-latest
container:
image: golang:1.20

steps:
- name: clone
uses: actions/checkout@v3

- name: install go
uses: actions/setup-go@v4
with:
# use version from go.mod file
go-version-file: 'go.mod'
cache: true
check-latest: true

- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ on:
jobs:
test:
runs-on: ubuntu-latest
container:
image: golang:1.20

steps:
- name: clone
uses: actions/checkout@v3

- name: install go
uses: actions/setup-go@v4
with:
# use version from go.mod file
go-version-file: 'go.mod'
cache: true
check-latest: true

- name: test
run: |
go test -race -covermode=atomic -coverprofile=coverage.out ./...
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ on:
jobs:
validate:
runs-on: ubuntu-latest
container:
image: golang:1.20

steps:
- name: clone
uses: actions/checkout@v3

- name: install go
uses: actions/setup-go@v4
with:
# use version from go.mod file
go-version-file: 'go.mod'
cache: true
check-latest: true

- name: validate
run: |
# Check that go mod tidy produces a zero diff; clean up any changes afterwards.
Expand Down

0 comments on commit 8ac07e4

Please sign in to comment.