Files
coredns/.github/workflows/go.test.yml
Yong Tang 4382b80a35 core: upgrade Go requirement to 1.26.0 (#8466)
* core: upgrade Go requirement to 1.26.0

As golang 1.27 has been released, this PR
- Bump Go version requirement to 1.26.0
- Update Go build version to 1.27.0

This is also for solving the issue encountered in 8092 of k8s update

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Bump golang ci

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Migrate faillint to forbidigo, as failint has not bee updated for more than a year

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

---------

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2026-09-10 19:34:44 -07:00

137 lines
3.6 KiB
YAML

name: Go Tests
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: .go-version
id: go
- name: Build
run: go build -v ./...
- name: Test
run: |
( cd request; go test -race ./... )
( cd core; go test -race ./... )
( cd coremain; go test -race ./... )
test-windows:
name: Test Windows
runs-on: windows-latest
steps:
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: .go-version
id: go
- name: Build
run: go build -v ./...
- name: Test
shell: bash
run: |
( cd request; go test -race ./... )
( cd core; go test -race ./... )
( cd coremain; go test -race ./... )
test-plugins:
name: Test Plugins
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: .go-version
id: go
- name: Build
run: go build -v ./...
- name: Test
shell: bash
run: ( cd plugin; go test -race ./... )
test-e2e:
name: Test e2e
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: .go-version
id: go
- name: Build
run: go build -v ./...
- name: Test
run: |
( cd test; go test -race ./... )
test-makefile-release:
name: Test Makefile.release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install dependencies
run: sudo apt-get install make curl
- name: Test Makefile.release release
run: make GITHUB_ACCESS_TOKEN=x release -f Makefile.release
- name: Test Makefile.release release/github-push (dry-run)
run: make GITHUB_ACCESS_TOKEN=x -n release github-push -f Makefile.release
- name: Test Makefile.docker release/github-push (dry-run)
run: make VERSION=x DOCKER=x -n release docker-push -f Makefile.docker
- name: Prepare Docker build
run: |
for arch in amd64 arm arm64 mips64le ppc64le s390x riscv64 loong64; do
mkdir -p build/docker/$arch
cp build/linux/$arch/coredns build/docker/$arch/
done
- name: Test Makefile.docker build
run: make VERSION=x DOCKER=x -f Makefile.docker docker-build