diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e8a408b17..cbb9a8c6c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: - { goos: linux, goarch: '386', output: '386' } - { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible } - - { goos: linux, goarch: amd64, goamd64: v3, output: amd64 } + - { goos: linux, goarch: amd64, goamd64: v3, output: amd64, test: true } - { goos: linux, goarch: arm64, output: arm64 } - { goos: linux, goarch: arm, goarm: '7', output: armv7 } - { goos: linux, goarch: mips, mips: hardfloat, output: mips-hardfloat } @@ -62,32 +62,35 @@ jobs: - { goos: android, goarch: arm, ndk: armv7a-linux-androideabi34, output: armv7 } - { goos: android, goarch: arm64, ndk: aarch64-linux-android34, output: arm64-v8 } - - { goos: windows, goarch: '386', output: '386-go120', version: 20 } - - { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, version: 20 } - - { goos: windows, goarch: amd64, goamd64: v3, output: amd64-go120, version: 20 } + # Go 1.20 is the last release that will run on any release of Windows 7, 8, Server 2008 and Server 2012. Go 1.21 will require at least Windows 10 or Server 2016. + - { goos: windows, goarch: '386', output: '386-go120', goversion: '1.20' } + - { goos: windows, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20' } + - { goos: windows, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' } - - { goos: darwin, goarch: arm64, output: arm64-go120, version: 20 } - - { goos: darwin, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, version: 20 } - - { goos: darwin, goarch: amd64, goamd64: v3, output: amd64-go120, version: 20 } + # Go 1.20 is the last release that will run on macOS 10.13 High Sierra or 10.14 Mojave. Go 1.21 will require macOS 10.15 Catalina or later. + - { goos: darwin, goarch: arm64, output: arm64-go120, goversion: '1.20' } + - { goos: darwin, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20' } + - { goos: darwin, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' } - - { goos: linux, goarch: '386', output: '386-go120', version: 20 } - - { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, version: 20 } - - { goos: linux, goarch: amd64, goamd64: v3, output: amd64-go120, version: 20 } + # only for test + - { goos: linux, goarch: '386', output: '386-go120', goversion: '1.20' } + - { goos: linux, goarch: amd64, goamd64: v1, output: amd64-compatible-go120, goversion: '1.20', test: true } + - { goos: linux, goarch: amd64, goamd64: v3, output: amd64-go120, goversion: '1.20' } steps: - uses: actions/checkout@v4 - - name: Set up Go1.22 - if: ${{ matrix.jobs.version != '20' && matrix.jobs.goarch != 'loong64' }} + - name: Set up Go + if: ${{ matrix.jobs.goversion == '' && matrix.jobs.goarch != 'loong64' }} uses: actions/setup-go@v5 with: go-version: '1.22' - - name: Set up Go1.20 - if: ${{ matrix.jobs.version == '20' && matrix.jobs.goarch != 'loong64' }} + - name: Set up Go + if: ${{ matrix.jobs.goversion != '' && matrix.jobs.goarch != 'loong64' }} uses: actions/setup-go@v5 with: - go-version: '1.20' + go-version: ${{ matrix.jobs.goversion }} - name: Set up Go1.21 loongarch abi1 if: ${{ matrix.jobs.goarch == 'loong64' && matrix.jobs.abi == '1' }} @@ -135,7 +138,12 @@ jobs: echo "CGO_ENABLED=1" >> $GITHUB_ENV echo "BUILDTAG=" >> $GITHUB_ENV - - name: build core + - name: Test + if: ${{ matrix.jobs.test == 'true' }} + run: | + go test ./... + + - name: Build core env: GOOS: ${{matrix.jobs.goos}} GOARCH: ${{matrix.jobs.goarch}}