Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/actions/go_init/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Go Init
description: Initializes go and runs go generate

runs:
using: "composite"
steps:
- name: Set up Go
uses: actions/setup-go@v4

- name: Reset sources
shell: bash
run: rm -Rf sources/

- name: Checkout
uses: actions/checkout@v3
with:
repository: overmindtech/aws-source
path: sources/aws-source

- name: Go Generate
shell: bash
run: |
go generate ./...
if [ -z "$(git status --porcelain | grep -v 'T sources/')" ]; then
echo "No pending changes from 'go generate'"
else
echo "Pending changes from 'go generate' found, please run 'go generate ./...' and commit the changes"
git status
exit 1
fi
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
- name: Go Init
uses: ./.github/actions/go_init

- name: Run GoReleaser (publish)
uses: goreleaser/goreleaser-action@v4
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ jobs:
env:
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- name: Checkout
uses: actions/checkout@v3
with:
go-version: 1.x
fetch-depth: 0

- name: Go Init
uses: ./.github/actions/go_init

- name: Get dependencies
run: |
Expand All @@ -27,11 +30,14 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- name: Checkout
uses: actions/checkout@v3
with:
go-version: '1.20'
cache: false
fetch-depth: 0

- name: Go Init
uses: ./.github/actions/go_init

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
go.work

dist/
tracing/commit.txt
Loading