diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 02dcb03..1bc4f69 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,67 +6,73 @@ permissions: contents: read jobs: - build: - name: Test on ${{ matrix.os }} / ${{ matrix.arch }} - runs-on: ${{ matrix.os }} + regular: + name: ${{ matrix.label }} + runs-on: ${{ matrix.image }} strategy: matrix: include: - - os: ubuntu-latest - arch: amd64 - - os: ubuntu-24.04-arm - arch: arm64 - - os: windows-latest - arch: amd64 - - os: macos-26-intel - arch: amd64 - - os: macos-26 - arch: arm64 + - image: ubuntu-latest + label: Linux / x86-64 + - image: ubuntu-24.04-arm + label: Linux / arm64 + - image: macos-15-intel + label: macOS / x86-64 + - image: macos-latest + label: macOS / arm64 + - image: windows-latest + label: Windows / x86-64 steps: - uses: actions/checkout@v6 - - name: Set up Go uses: actions/setup-go@v6 with: go-version-file: './go.mod' - - - name: Test examples - run: go test -v -gcflags="all=-N -l" ./examples/... - - - name: Unit tests - run: go test -v -gcflags="all=-N -l" -coverprofile coverage.out . - + - name: Test + run: | + go test -v -gcflags="all=-N -l" ./examples/... + go test -v -gcflags="all=-N -l" -coverprofile coverage.out . - name: Upload coverage reports to Codecov - if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'amd64' && github.ref == 'refs/heads/main' }} + if: ${{ matrix.image == 'ubuntu-latest' && github.ref == 'refs/heads/main' }} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} - freebsd-amd64: - name: Test on freebsd / amd64 - runs-on: ubuntu-latest + win-arm64: + name: Windows / arm64 + runs-on: windows-11-arm steps: + # Prevent Git from converting LF to CRLF, which can cause test failures on Windows + - name: Configure Git for Windows + run: git config --global core.autocrlf input - uses: actions/checkout@v6 - - name: Test - uses: vmactions/freebsd-vm@v1 + - name: Set up Go + uses: msys2/setup-msys2@v2 with: - usesh: true - copyback: false - prepare: | - pkg install -y go - run: | - go test -v -gcflags="all=-N -l" ./examples/... - go test -v -gcflags="all=-N -l" -coverprofile coverage.out . + msystem: CLANGARM64 + install: mingw-w64-clang-aarch64-gcc-compat mingw-w64-clang-aarch64-go + - name: Test + shell: msys2 {0} + run: | + go test -v -gcflags="all=-N -l" ./examples/... + go test -v -gcflags="all=-N -l" -coverprofile coverage.out . - freebsd-arm64: - name: Test on freebsd / arm64 + freebsd: + name: ${{ matrix.label }} runs-on: ubuntu-latest + strategy: + matrix: + include: + - arch: x86_64 + label: FreeBSD / x86-64 + - arch: aarch64 + label: FreeBSD / arm64 steps: - uses: actions/checkout@v6 - name: Test uses: vmactions/freebsd-vm@v1 with: - arch: aarch64 + arch: ${{ matrix.arch }} usesh: true copyback: false prepare: |