mirror of
https://github.com/coredns/coredns.git
synced 2026-07-21 07:00:10 -04:00
Plugin package tests previously ran only on Linux, so Windows- specific failures were never caught. Run them in CI and make the affected tests portable across platforms. Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
138 lines
3.7 KiB
YAML
138 lines
3.7 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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
|
with:
|
|
go-version-file: .go-version
|
|
id: go
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Test
|
|
run: |
|
|
go install github.com/fatih/faillint@c56e3ec6dbfc933bbeb884fd31f2bcd41f712657 # v1.15.0
|
|
( cd test; go test -race ./... )
|
|
|
|
test-makefile-release:
|
|
name: Test Makefile.release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
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
|