From 5775c95ed63df648e86b3748b6dbdca00b975fbb Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Fri, 7 Aug 2026 15:59:30 +0100 Subject: [PATCH] Update CI --- .github/workflows/test.yml | 41 +++++++++++++++++++++++++------------- go.mod | 2 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e482038..578aa5a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,20 +1,33 @@ -name: 'test backend' -on: ['push', 'pull_request'] +name: 'test' +on: + pull_request: + paths: ['**.go', 'go.mod', '.github/workflows/*'] + push: + branches: ['main'] jobs: - test: - name: 'test (linux)' - runs-on: 'ubuntu-latest' - steps: - - uses: 'actions/checkout@v4' - - name: 'test (linux)' - run: | - go test -race ./... - staticcheck: name: 'staticcheck' runs-on: 'ubuntu-latest' steps: - - uses: 'actions/checkout@v4' - - uses: 'dominikh/staticcheck-action@v1.3.1' - with: {version: '2025.1.1'} + - uses: 'actions/checkout@v6' + - uses: 'dominikh/staticcheck-action@v1' + + test: + strategy: + matrix: + go: ['1.23.x', '1.26.x'] + os: ['ubuntu-latest', 'ubuntu-24.04-arm', 'macos-latest', 'windows-latest', 'windows-11-arm'] + runs-on: ${{ matrix.os }} + steps: + - uses: 'actions/checkout@v6' + - uses: 'actions/setup-go@v6' + with: + go-version: ${{ matrix.go }} + - shell: 'bash' + run: | + # "-race is not supported on windows/arm64" + race='-race' + [ $RUNNER_OS = 'Windows' ] && [ $RUNNER_ARCH = 'ARM64' ] && race='' + + go test $race ./... diff --git a/go.mod b/go.mod index 150f49d..35aae94 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module zgo.at/isbot -go 1.19 +go 1.23