mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
* Repo controlled Go version Signed-off-by: xdu31 <jasonxdu@amazon.com> * Bump to go1.21.8 for CVE update Signed-off-by: xdu31 <jasonxdu@amazon.com> --------- Signed-off-by: xdu31 <jasonxdu@amazon.com>
90 lines
2.0 KiB
YAML
90 lines
2.0 KiB
YAML
name: Go Tests
|
|
on: [push, pull_request]
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go Version
|
|
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ env.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-plugins:
|
|
name: Test Plugins
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go Version
|
|
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
id: go
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Test
|
|
run: ( cd plugin; go test -race ./... )
|
|
|
|
test-e2e:
|
|
name: Test e2e
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '~1.21.0'
|
|
id: go
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Test
|
|
run: |
|
|
go install github.com/fatih/faillint@latest
|
|
( cd test; go test -race ./... )
|
|
|
|
test-makefile-release:
|
|
name: Test Makefile.release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: sudo apt-get install make curl
|
|
|
|
- name: Test Makefile.release
|
|
run: make GITHUB_ACCESS_TOKEN=x -n release github-push -f Makefile.release
|
|
|
|
- name: Test Makefile.docker
|
|
run: make VERSION=x DOCKER=x -n release docker-push -f Makefile.docker
|