Merge pull request #57 from thaJeztah/gofumpt_all_the_things #237
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: test | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'releases/v*' | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
prepare-validate: | |
runs-on: ubuntu-latest | |
outputs: | |
targets: ${{ steps.generate.outputs.targets }} | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: List targets | |
id: generate | |
uses: docker/bake-action/subaction/list-targets@v6 | |
with: | |
target: validate | |
validate: | |
runs-on: ubuntu-latest | |
needs: | |
- prepare-validate | |
strategy: | |
fail-fast: false | |
matrix: | |
target: ${{ fromJson(needs.prepare-validate.outputs.targets) }} | |
steps: | |
- | |
name: Validate | |
uses: docker/bake-action@v6 | |
with: | |
targets: ${{ matrix.target }} | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Test | |
uses: docker/bake-action@v6 | |
with: | |
targets: test | |
- | |
name: Upload coverage | |
uses: codecov/codecov-action@v5 | |
with: | |
files: ./coverage.txt | |
token: ${{ secrets.CODECOV_TOKEN }} | |
example: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.20" | |
- | |
name: Download modules | |
run: | | |
go mod download | |
working-directory: ./example | |
- | |
name: Run | |
run: | | |
go run main.go | |
working-directory: ./example | |
- | |
name: List docs | |
run: | | |
tree -nh ./example/docs | |
- | |
name: Upload docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: example-docs | |
path: ./example/docs/* | |
if-no-files-found: error |