Update README.md and improve test coverage (#7) #45
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: VersionBump CI | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
outputs: | |
cache-key: ${{ steps.cache-deps.outputs.cache-hit }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22.2' | |
- name: Cache Go modules | |
id: cache-deps | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Install dependencies | |
run: make init-project | |
test: | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22.2' | |
- name: Restore Go modules cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ needs.setup.outputs.cache-key }} | |
- name: Run tests | |
run: make test | |
lint: | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22.2' | |
- name: Restore Go modules cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ needs.setup.outputs.cache-key }} | |
- name: Run lint checks | |
run: | | |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | |
make lint |