changelog++ #386
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
# Run this workflow on pushes and manually | |
on: [push, workflow_dispatch] | |
jobs: | |
test: | |
env: | |
TARBALL_FILE: vault-k8s-image.docker.tar | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 | |
with: | |
go-version-file: .go-version | |
- name: Build | |
run: | | |
REGISTRY=hashicorp make build image | |
docker save --output "${TARBALL_FILE}" hashicorp/vault-k8s:0.0.0-dev | |
- name: Test | |
run: make test | |
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
with: | |
name: vault-k8s-image | |
path: ${{ env.TARBALL_FILE }} | |
acceptance: | |
needs: | |
- test | |
strategy: | |
fail-fast: false | |
matrix: | |
kind-k8s-version: [1.23.17, 1.24.15, 1.25.11, 1.26.6, 1.27.3] | |
runs-on: ubuntu-latest | |
steps: | |
# Setup test tools from https://github.com/hashicorp/vault-helm/blob/main/.github/workflows/setup-test-tools/action.yaml | |
- uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 | |
- run: npm install -g bats@${BATS_VERSION} | |
shell: bash | |
env: | |
BATS_VERSION: '1.8.2' | |
- run: bats -v | |
shell: bash | |
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0 | |
with: | |
python-version: '3.10' | |
- run: pip install yq | |
shell: bash | |
# Checkout vault-helm for acceptance test code. | |
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
with: | |
repository: "hashicorp/vault-helm" | |
ref: "v0.25.0" | |
path: "vault-helm" | |
- name: Create K8s Kind Cluster | |
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0 | |
with: | |
cluster_name: kind | |
config: vault-helm/test/kind/config.yaml | |
node_image: kindest/node:v${{ matrix.kind-k8s-version }} | |
version: v0.20.0 | |
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: vault-k8s-image | |
- name: Load vault-k8s dev image | |
run: | | |
docker image load --input vault-k8s-image.docker.tar | |
kind load docker-image hashicorp/vault-k8s:0.0.0-dev | |
- name: bats tests | |
run: | | |
yq --in-place --yaml-roundtrip '.injector.image.tag |= "0.0.0-dev"' ./vault-helm/values.yaml | |
bats ./vault-helm/test/acceptance -t --filter injector |