feat: initiate benchmarking with filter function #13
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 Tests and Format | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
go: | |
name: Go ${{ matrix.task }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
task: [fmt, test, benchmark] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: "^1.22.1" | |
- name: Install environment dependencies | |
run: apt install graphviz # required for pprof | |
- name: Install Go dependencies | |
run: go mod tidy | |
# jobs | |
- name: Run go fmt | |
if: matrix.task == 'fmt' | |
run: | | |
if [ -n "$(go fmt ./...)" ]; then | |
echo "Go files must be formatted with gofmt." | |
exit 1 | |
fi | |
- name: Run go test | |
if: matrix.task == 'test' | |
run: go test -v ./... | |
- name: Take benchmarks | |
if: matrix.task == 'benchmark' | |
run: bash ./benchmarks/take_benchmarks.sh |