Files
nomad/.github/workflows/test-core.yaml
Seth Hoenig f715cc1488 ci: use groups of tests in gha (#15018)
* [no ci] use json for grouping packages for testing

* [no ci] able to get packages in group

* [no ci] able to run groups of tests

* [no ci] more

* [no ci] try disable circle unit tests

* ci: use actions/checkout@v3

* ci: rename to quick

* ci: need make dev in mods cache step

* ci: make compile step depend on checks step

* ci: bump consul and vault versions

* ci: need make dev for group tests

* ci: update ci unit testing docs

* docs: spell plumbing correctly

Co-authored-by: Tim Gross <tgross@hashicorp.com>

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2022-10-27 09:02:58 -05:00

132 lines
3.3 KiB
YAML

name: Core CI Tests
on:
push:
branches-ignore:
- main
- release-**
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- '.changelog/**'
- '.tours/**'
- 'contributing/**'
- 'demo/**'
- 'dev/**'
- 'e2e/terraform/**'
- 'e2e/ui/**'
- 'integrations/**'
- 'pkg/**'
- 'scripts/**'
- 'terraform/**'
- 'ui/**'
- 'website/**'
env:
VERBOSE: 1
GO_VERSION: 1.19.1
GOBIN: /usr/local/bin
GOTESTARCH: amd64
CONSUL_VERSION: 1.12.6
VAULT_VERSION: 1.12.0
NOMAD_SLOW_TEST: 0
NOMAD_TEST_LOG_LEVEL: OFF
jobs:
mods:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: magnetikonline/action-golang-cache@v1
with:
go-version: ${{env.GO_VERSION}}
cache-key-suffix: -core
- name: Pre-cache Go modules
run: |
make tidy
make bootstrap
checks:
needs: [mods]
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # needs tags for checkproto
- uses: magnetikonline/action-golang-cache@v1
with:
go-version: ${{env.GO_VERSION}}
cache-key-suffix: -core
- name: Run make check
run: |
make missing
make bootstrap
make check
compile:
needs: [mods, checks]
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-11, windows-2019]
runs-on: ${{matrix.os}}
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: magnetikonline/action-golang-cache@v1
with:
go-version: ${{env.GO_VERSION}}
cache-key-suffix: -core
- name: Run make dev
env:
GOBIN: ${{env.GOROOT}}/bin # windows kludge
run: |
make bootstrap
make dev
tests-api:
needs: [mods]
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: magnetikonline/action-golang-cache@v1
with:
go-version: ${{env.GO_VERSION}}
cache-key-suffix: -core
- name: Run API tests
env:
GOTEST_MOD: api
run: |
make bootstrap
make generate-all
sudo sed -i 's!Defaults!#Defaults!g' /etc/sudoers
sudo -E env "PATH=$PATH" make test-nomad-module
tests-groups:
needs: [mods]
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
groups:
- nomad
- client
- command
- drivers
- quick
steps:
- uses: actions/checkout@v3
- uses: magnetikonline/action-golang-cache@v1
with:
go-version: ${{env.GO_VERSION}}
cache-key-suffix: -core
- name: Run Matrix Tests
env:
GOTEST_GROUP: ${{matrix.groups}}
run: |
make bootstrap
make generate-all
make dev
sudo hc-install install -version ${{env.VAULT_VERSION}} -path /usr/local/bin vault
sudo hc-install install -version ${{env.CONSUL_VERSION}} -path /usr/local/bin consul
sudo sed -i 's!Defaults!#Defaults!g' /etc/sudoers
sudo -E env "PATH=$PATH" make test-nomad