Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasell committed Dec 16, 2024
1 parent dcb0259 commit 443823a
Show file tree
Hide file tree
Showing 3 changed files with 169 additions and 78 deletions.
160 changes: 88 additions & 72 deletions .github/workflows/test-core.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Core CI Tests

on:
pull_request:
paths-ignore:
Expand All @@ -21,6 +22,7 @@ on:
branches:
- main
- release/**
- f-NET-11243
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
Expand Down Expand Up @@ -49,78 +51,92 @@ env:
jobs:
checks:
uses: ./.github/workflows/checks.yaml
compile:
needs: [checks]
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14, windows-2019]
runs-on: ${{matrix.os}}
timeout-minutes: 20
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
cache: ${{ contains(runner.name, 'Github Actions') }}
go-version-file: .go-version
cache-dependency-path: '**/go.sum'
- name: Run make dev
run: |
make bootstrap
make dev
tests-api:
needs: [checks]
runs-on: custom-linux-xl-nomad-22.04
timeout-minutes: 8
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
cache: true
go-version-file: .go-version
cache-dependency-path: '**/go.sum'
- 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: [checks]
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
groups:
- nomad
- client
- command
- drivers
- quick
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
cache: ${{ contains(runner.name, 'Github Actions') }}
go-version-file: .go-version
cache-dependency-path: '**/go.sum'
- name: Install optional dependencies
if: ${{ matrix.groups == 'drivers' }}
run: sudo apt update && sudo apt install qemu-system
- name: Run Matrix Tests
env:
GOTEST_GROUP: ${{matrix.groups}}
run: |
make bootstrap
make generate-all
make dev
sudo -E env "PATH=$PATH" hc-install install -version ${{env.VAULT_VERSION}} -path '${{env.GOPATH}}/bin' vault
sudo -E env "PATH=$PATH" hc-install install -version ${{env.CONSUL_VERSION}} -path '${{env.GOPATH}}/bin' consul
sudo sed -i 's!Defaults!#Defaults!g' /etc/sudoers
sudo -E env "PATH=$PATH" make test-nomad
# compile:
# needs: [checks]
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-24.04, macos-14, windows-2019]
# runs-on: ${{matrix.os}}
# timeout-minutes: 20
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
# with:
# cache: ${{ contains(runner.name, 'Github Actions') }}
# go-version-file: .go-version
# cache-dependency-path: '**/go.sum'
# - name: Run make dev
# run: |
# make bootstrap
# make dev
# tests-api:
# needs: [checks]
# runs-on: custom-linux-xl-nomad-22.04
# timeout-minutes: 8
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
# with:
# cache: true
# go-version-file: .go-version
# cache-dependency-path: '**/go.sum'
# - 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: [checks]
# runs-on: ubuntu-22.04
# timeout-minutes: 30
# strategy:
# fail-fast: false
# matrix:
# groups:
# - nomad
# - client
# - command
# - drivers
# - quick
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
# with:
# cache: ${{ contains(runner.name, 'Github Actions') }}
# go-version-file: .go-version
# cache-dependency-path: '**/go.sum'
# - name: Install optional dependencies
# if: ${{ matrix.groups == 'drivers' }}
# run: sudo apt update && sudo apt install qemu-system
# - name: Run Matrix Tests
# env:
# GOTEST_GROUP: ${{matrix.groups}}
# run: |
# make bootstrap
# make generate-all
# make dev
# sudo -E env "PATH=$PATH" hc-install install -version ${{env.VAULT_VERSION}} -path '${{env.GOPATH}}/bin' vault
# sudo -E env "PATH=$PATH" hc-install install -version ${{env.CONSUL_VERSION}} -path '${{env.GOPATH}}/bin' consul
# sudo sed -i 's!Defaults!#Defaults!g' /etc/sudoers
# sudo -E env "PATH=$PATH" make test-nomad

handle-failure:
needs:
- checks
if: |
always() && github.event_name == 'push' && needs.checks.result == 'failure'
uses: ./.github/workflows/test-failure-notification.yml
secrets: inherit
with:
actor: ${{ github.triggering_actor }}
git-branch: ${{ github.ref_name }}
workflow-run-id: ${{ github.run_id }}
workflow-name: ${{ github.workflow }}

permissions:
contents: read
id-token: write
75 changes: 75 additions & 0 deletions .github/workflows/test-failure-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI Test Failure Notification

on:
workflow_call:
inputs:
actor:
description: 'Triggering actor of the failed the workflow'
required: true
type: string
git-branch:
description: 'Git branch name'
required: true
type: string
workflow-name:
description: 'Name of the GitHub Action workflow'
required: true
type: string
workflow-run-id:
description: 'GitHub Action run ID that failed'
required: true
type: string

jobs:
send-notification:
runs-on: ${{ endsWith(github.repository, '-enterprise') && fromJSON('["self-hosted", "ondemand", "linux"]') || 'ubuntu-latest' }}
steps:
- name: Retrieve Vault-hosted Secrets
if: endsWith(github.repository, '-enterprise')
id: vault
uses: hashicorp/vault-action@d1720f055e0635fd932a1d2a48f87a666a57906c # v3.0.0
with:
url: ${{ vars.CI_VAULT_URL }}
method: ${{ vars.CI_VAULT_METHOD }}
path: ${{ vars.CI_VAULT_PATH }}
jwtGithubAudience: ${{ vars.CI_VAULT_AUD }}
secrets: |-
kv/data/teams/nomad/slack-webhooks feed-nomad | SLACK_FEED_NOMAD ;
- name: Send Slack notification
env:
SLACK_WEBHOOK_URL: "${{ secrets.SLACK_FEED_NOMAD_CI_FAILURE }}"
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
with:
payload: |
{
"text": ":x: CI Workflow '${{ inputs.workflow-name }}' *FAILED*",
"attachments": [
{
"color": "#C41E3A",
"blocks": [
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Branch:* <${{ github.server_url }}/${{ github.repository }}/tree/${{ inputs.git-branch }}|${{ inputs.git-branch }}>"
},
{
"type": "mrkdwn",
"text": "*From:* @${{ inputs.actor }}"
},
{
"type": "mrkdwn",
"text": "*Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ inputs.workflow-run-id }}|${{ inputs.workflow-run-id }}>"
}
]
}
]
}
]
}
permissions:
contents: read
id-token: write
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ replace github.com/hashicorp/nomad/api => ./api

require (
github.com/LK4D4/joincontext v0.0.0-20171026170139-1724345da6d5
github.com/Masterminds/sprig/v3 v3.2.3
github.com/Masterminds/sprig/v3 v3.3.0
github.com/Microsoft/go-winio v0.6.1
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e
github.com/armon/go-metrics v0.5.3
Expand Down Expand Up @@ -146,7 +146,7 @@ require (
cloud.google.com/go/iam v1.1.2 // indirect
cloud.google.com/go/kms v1.15.2 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
dario.cat/mergo v1.0.0 // indirect
dario.cat/mergo v1.0.1 // indirect
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
Expand All @@ -168,7 +168,7 @@ require (
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/DataDog/datadog-go v3.2.0+incompatible // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Masterminds/semver/v3 v3.3.0 // indirect
github.com/VividCortex/ewma v1.1.1 // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/apparentlymart/go-cidr v1.0.1 // indirect
Expand Down Expand Up @@ -235,7 +235,7 @@ require (
github.com/hashicorp/mdns v1.0.4 // indirect
github.com/hashicorp/vault/api/auth/kubernetes v0.5.0 // indirect
github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07 // indirect
github.com/jefferai/isbadcipher v0.0.0-20190226160619-51d2077c035f // indirect
Expand Down Expand Up @@ -271,10 +271,10 @@ require (
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/seccomp/libseccomp-golang v0.10.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/softlayer/softlayer-go v0.0.0-20180806151055-260589d94c7d // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/tencentcloud/tencentcloud-sdk-go v1.0.162 // indirect
Expand Down

0 comments on commit 443823a

Please sign in to comment.