-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Gofumpt * Workflow for formatting check and test * Docker build step
- Loading branch information
1 parent
cb5e790
commit 52a25d0
Showing
5 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: default-pipeline | ||
on: [push] | ||
jobs: | ||
check-format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '^1.21.2' | ||
- name: Install gofumpt | ||
run: go install mvdan.cc/gofumpt@latest | ||
- name: Check formatting | ||
run: gofumpt -w -l . && git diff --exit-code | ||
unit-test: | ||
runs-on: ubuntu-latest | ||
needs: [check-format] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '^1.21.2' | ||
- name: Run tests | ||
run: go test | ||
build-docker-image: | ||
runs-on: ubuntu-latest | ||
needs: [unit-test] | ||
if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
env: | ||
TAG_NAME: ${{ github.ref_name }} | ||
IMAGE_NAME: ghcr.io/mahesh-hegde/zserv | ||
steps: | ||
- name: Docker login | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | ||
- name: Docker build | ||
run: docker build -t ghcr.io/mahesh-hegde/zserv:latest . | ||
- name: Push latest image | ||
run: docker push $IMAGE_NAME:latest | ||
- name: Tag image | ||
run: docker tag $IMAGE_NAME:latest $IMAGE_NAME:${TAG_NAME#v} | ||
- name: Push tagged image | ||
run: docker push $IMAGE_NAME:${TAG_NAME#v} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,7 +107,6 @@ func main() { | |
} | ||
|
||
if options.DetectRoot { | ||
|
||
verbose("Detect root as: %s") | ||
} | ||
|
||
|
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