update #220
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: Test | |
on: [push, pull_request] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
go-version: ["1.19", "1.20"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install tools | |
run: curl --version | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Test with retry | |
if: matrix.os != 'ubuntu-latest' | |
run: | | |
attempt=0 | |
max_attempts=3 | |
until [ $attempt -ge $max_attempts ] | |
do | |
go test -v ./pkg/... && break | |
attempt=$((attempt+1)) | |
echo "Test failed, retrying ($attempt/$max_attempts)..." | |
if [ $attempt -ge $max_attempts ]; then | |
echo "Test failed after $max_attempts attempts" | |
exit 1 | |
fi | |
sleep 10 | |
done | |
- name: Test with coverage | |
if: matrix.os == 'ubuntu-latest' | |
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./pkg/... | |
- name: Codecov | |
if: matrix.os == 'ubuntu-latest' | |
uses: codecov/codecov-action@v3 | |
- name: End to end test | |
run: make e2e | |
if: matrix.os == 'ubuntu-latest' |