Skip to content

trying

trying #228

Workflow file for this run

# This workflow will run the tests on the go version of tictactoe
name: go
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tictactoe_go
strategy:
fail-fast: false
matrix:
go-version: [ '1.19', '1.20', '1.21', '1.22']
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
working-directory: ./tictactoe_go
version: v1.56
- name: Build
run: go build
- name: Test
run: |
go test -covermode=count -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
- name: Fuzz
run: |
go test -fuzz=FuzzSwapPlayer -fuzztime 30s
go test -fuzz=FuzzGetEmptyCells -fuzztime 30s
go test -fuzz=FuzzRandomMove -fuzztime 30s
go test -fuzz=FuzzMinMax -fuzztime 60s
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.go-version }}
path: ./tictactoe_go/coverage.html