diff --git a/.github/workflows/go-test-darwin.yml b/.github/workflows/go-test-darwin.yml deleted file mode 100644 index fddbd3cb..00000000 --- a/.github/workflows/go-test-darwin.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -# This workflow will run tests for Go on a macOS runner. - -name: Go Test macOS - -on: - push: - branches: - - main - pull_request: - -permissions: - contents: read - -jobs: - get-go-version: - runs-on: ubuntu-latest - outputs: - go-version: ${{ steps.get-go-version.outputs.go-version }} - steps: - - name: Checkout Repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Get Go Version - id: get-go-version - run: | - echo "Found Go $(cat .go-version)" - echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT - darwin-go-tests: - needs: - - get-go-version - runs-on: macos-latest - name: Darwin Go Tests - steps: - - name: Checkout Repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Setup Go - uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 - with: - go-version: ${{ needs.get-go-version.outputs.go-version }} - - run: | - echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}" - go test -race -count 1 ./... -timeout=3m diff --git a/.github/workflows/go-test-linux.yml b/.github/workflows/go-test-linux.yml deleted file mode 100644 index b8503289..00000000 --- a/.github/workflows/go-test-linux.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -# This workflow will run tests for Go on a Linux runner. - -name: Go Test Linux - -on: - push: - branches: - - main - pull_request: - -permissions: - contents: read - -jobs: - get-go-version: - runs-on: ubuntu-latest - outputs: - go-version: ${{ steps.get-go-version.outputs.go-version }} - steps: - - name: Checkout Repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Get Go Version - id: get-go-version - run: | - echo "Found Go $(cat .go-version)" - echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT - linux-go-tests: - needs: - - get-go-version - runs-on: ubuntu-latest - name: Linux Go Tests - steps: - - name: Checkout Repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Setup Go - uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 - with: - go-version: ${{ needs.get-go-version.outputs.go-version }} - - run: | - echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}" - go test -race -count 1 ./... -timeout=3m diff --git a/.github/workflows/go-test-windows.yml b/.github/workflows/go-test-windows.yml deleted file mode 100644 index 006fa2f8..00000000 --- a/.github/workflows/go-test-windows.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -# This workflow will run tests for Go on a Windows runner. - -name: Go Test Windows - -on: - push: - branches: - - main - pull_request: - -permissions: - contents: read - -jobs: - get-go-version: - runs-on: ubuntu-latest - outputs: - go-version: ${{ steps.get-go-version.outputs.go-version }} - steps: - - name: Checkout Repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Get Go Version - id: get-go-version - run: | - echo "Found Go $(cat .go-version)" - echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT - windows-go-tests: - needs: - - get-go-version - runs-on: windows-latest - name: Windows Go Tests - steps: - - name: Checkout Repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Setup Go - uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 - with: - go-version: ${{ needs.get-go-version.outputs.go-version }} - - run: | - echo "Testing with Go ${{ needs.get-go-version.outputs.go-version }}" - go test -race -count 1 ./... -timeout=3m diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml new file mode 100644 index 00000000..33fd1817 --- /dev/null +++ b/.github/workflows/go-test.yml @@ -0,0 +1,39 @@ +--- +# This workflow will run the tests across a matrix of operating systems. + +name: Go Test + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + go-tests: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + name: Go Tests (${{ matrix.os }}) + steps: + - name: Checkout Repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup Go + uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0 + with: + go-version-file: go.mod + cache: true + - name: Run Tests + shell: bash + run: | + echo "Testing with $(go env GOVERSION) on ${{ matrix.os }}" + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + go test -race -count 1 ./... -timeout=3m + else + go test -count 1 ./... -timeout=3m + fi \ No newline at end of file