Refactor example directory #286
Workflow file for this run
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 | |
on: | |
push: | |
branches: | |
- v2 | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- '**.go' | |
- 'go.mod' | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Remove symlink 2to3 | |
if: runner.os == 'macos-latest' | |
run: | | |
: # Fix of "brew link" error of [email protected] | |
rm '/usr/local/bin/2to3' | |
- name: Set up Graphviz | |
uses: ts-graphviz/setup-graphviz@v2 | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: | | |
go test -v ./... | |
cd tokenizer; go test -benchmem -bench .; cd .. | |
coverage: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
cache: true | |
- name: Install goveralls | |
run: go install github.com/mattn/goveralls@latest | |
- name: Coverage | |
run: | | |
go test -v -coverprofile=profile.cov -covermode=atomic ./... | |
goveralls -coverprofile=profile.cov -service=github | |
env: | |
COVERALLS_TOKEN: ${{ github.token }} |