Merge pull request #24 from werniq/fix/factory-interface-params #319
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go-Gator | |
on: | |
push | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
launch: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- name: Install go-tools using go get | |
run: | |
go get -u honnef.co/go/tools | |
- name: Explicit installment of staticcheck | |
run: | |
go install honnef.co/go/tools/cmd/[email protected] | |
- name: Install go-task with curl | |
run: | |
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin | |
- name: Format code using go fmt | |
run: task fmt | |
- name: Analyze code for bugs and errors | |
run: task vet | |
- name: Clean go.mod dependencies | |
run: task clean | |
- name: Run staticcheck on the project | |
run: task stch | |
- name: Check for differences and fail if changes were detected | |
run: | | |
git diff --exit-code || echo "has-diff=true" >> $GITHUB_ENV | |
if [ "$has-diff" = "true" ]; then | |
echo 'Go fmt formatted files. Please, prepare files before pushing to the main branch. Exiting...' | |
exit 1 | |
fi | |
- name: Test application | |
run: task test | |
- name: Build docker image | |
run: | |
docker build -t go-gator . |