From a8507f1c254965e6aee3c3d1c757ea94d3bced67 Mon Sep 17 00:00:00 2001 From: Broderick Westrope Date: Sun, 18 Aug 2024 21:17:28 +1000 Subject: [PATCH] ci: add test workflow --- .github/workflows/go.yaml | 17 ----------------- .github/workflows/test.yaml | 38 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 17 deletions(-) delete mode 100644 .github/workflows/go.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml deleted file mode 100644 index 05b4d60..0000000 --- a/.github/workflows/go.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Go -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v4 - with: - go-version: '1.21.x' - - name: Install dependencies - run: go get ./... - - name: Test with the Go CLI - run: go test -cover ./... diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..b99210a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,38 @@ +name: Test + +on: + pull_request: + push: + tags: + - v* + branches: + - main + +jobs: + test: + name: Test + strategy: + matrix: + go-version: [1.23.x] + platform: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{matrix.platform}} + steps: + - name: Set up Go ${{matrix.go-version}} + uses: actions/setup-go@v5 + with: + go-version: ${{matrix.go-version}} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + + - name: Download Go modules + run: go mod download + env: + GOPROXY: https://proxy.golang.org + + - name: Build + run: go build -o ./bin/tetrigo -v ./cmd/tetrigo + + - name: Test + run: ./bin/tetrigo test --output=group --output-group-begin='::group::{{.TASK}}' --output-group-end='::endgroup::' \ No newline at end of file