Make all tests pass #15
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: | |
- master | |
pull_request: | |
jobs: | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache-dependency-path: go.sum | |
- name: Generate code | |
run: go generate ./... | |
working-directory: go | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
install-mode: goinstall | |
version: latest | |
working-directory: go | |
args: --config="${GITHUB_WORKSPACE}/go/.golangci.yaml" | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: go | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache-dependency-path: go.sum | |
- name: Install dependencies | |
run: go mod tidy | |
- name: Generate code | |
run: go generate ./... | |
- name: Compile | |
run: go build -v ./... | |
- name: Run tests | |
run: go test -v ./... | |
benchmark: | |
name: benchmark | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: go | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache-dependency-path: go.sum | |
- name: Generate code | |
run: go generate ./... | |
- name: Run benchmark | |
run: go test ./cmd/glox -bench=. -count 5 -run=^# -timeout 30m | tee output.txt | |
- name: Download previous benchmark data | |
uses: actions/cache@v4 | |
with: | |
path: ./cache | |
key: ${{ runner.os }}-benchmark | |
- name: Store benchmark result | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
tool: 'go' | |
output-file-path: go/output.txt | |
external-data-json-path: ./cache/benchmark-data.json | |
fail-on-alert: true | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
comment-on-alert: true |