Skip to content

Commit

Permalink
chore: Refactored acceptance test matrix
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Hipwell <[email protected]>
  • Loading branch information
stevehipwell committed Oct 25, 2024
1 parent 0c50865 commit 3df46c7
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 31 deletions.
32 changes: 23 additions & 9 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@ version: 2
updates:
- package-ecosystem: github-actions
directory: /
labels: [ dependencies ]
assignees: [ alekc ]
reviewers: [ alekc ]
groups:
github-actions:
patterns:
- "*"
update-types:
- minor
- patch
labels: [dependencies]
assignees: [alekc]
reviewers: [alekc]
commit-message:
prefix: "Dependencies:"
schedule:
interval: daily
- package-ecosystem: "gomod"
directory: "/"
labels: [ dependencies ]
assignees: [ alekc ]
reviewers: [ alekc ]
- package-ecosystem: gomod
directory: /
groups:
gomod:
patterns:
- "*"
update-types:
- minor
- patch
labels: [dependencies]
assignees: [alekc]
reviewers: [alekc]
commit-message:
prefix: "Dependencies:"
schedule:
interval: "daily"
interval: daily
10 changes: 5 additions & 5 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- name: Upload assets
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
path: dist/*
24 changes: 17 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,29 @@ jobs:
get_version_matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: imjasonh/setup-crane@31b88efe9de28ae0ffa220711af4b60be9435f6e # v0.4
- id: get_version_matrix
shell: bash
run: scripts/get-version-matrix.sh
run: |
set -euo pipefail
k8s_cycles="$(curl -sSfL https://endoflife.date/api/kubernetes.json | jq -rc '[sort_by(.releaseDate) | reverse | .[0:4] | .[].cycle]')"
kind_versions="$(crane ls docker.io/kindest/node | jq -sRrc --argjson cycles "${k8s_cycles}" 'split("\n") | [.[] | match("^v((\\d+\\.\\d+)\\.\\d+)$").captures | {cycle: .[1].string, version: .[0].string}] | group_by(.cycle) | [.[] | .[-1] | {(.cycle): {"version": .version}}] | reduce .[] as $item ({}; . *= $item) | . as $versions | [$cycles | .[] | $versions[.].version]')"
{
echo "terraform_versions=$(curl -sSfL https://endoflife.date/api/terraform.json | jq -rc '[sort_by(.releaseDate) | reverse | .[0:4] | .[].latest] + ["1.5.7"]')"
echo "k8s_versions=${kind_versions}"
} >> "${GITHUB_OUTPUT}"
outputs:
terraform_versions: ${{ steps.get_version_matrix.outputs.terraform_versions }}
k8s_versions: ${{ steps.get_version_matrix.outputs.k8s_versions }}
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
- name: Unit tests
Expand All @@ -47,12 +57,12 @@ jobs:
terraform_version: ${{ fromJson(needs.get_version_matrix.outputs.terraform_versions) }}
k8s_version: ${{ fromJson(needs.get_version_matrix.outputs.k8s_versions) }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod
- uses: helm/[email protected]
- uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
id: kind
with:
wait: 2m
Expand Down
10 changes: 0 additions & 10 deletions scripts/get-version-matrix.sh

This file was deleted.

0 comments on commit 3df46c7

Please sign in to comment.