-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (73 loc) · 2.62 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Tests
on: [push, workflow_dispatch, pull_request]
env:
KIND_VERSION: "v0.23.0"
BATS_VERSION: "1.11.0"
NODE_VERSION: "19.9.0"
TARBALL_FILE: openbao-csi-provider.docker.tar
jobs:
copyright:
uses: hashicorp/vault-workflows-common/.github/workflows/copyright-headers.yaml@main
go-checks:
uses: hashicorp/vault-workflows-common/.github/workflows/go-checks.yaml@main
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: .go-version
- name: Install tools
run: make bootstrap
- name: Lint
run: make lint GOLANGCI_LINT_FORMAT=github-actions
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version-file: .go-version
- name: Build
run: |
make e2e-image
docker save --output "${TARBALL_FILE}" e2e/openbao-csi-provider:latest
- name: Test
run: make test
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: openbao-csi-provider-image
path: ${{ env.TARBALL_FILE }}
integration-test:
needs:
- lint
- test
strategy:
fail-fast: false
matrix:
kind-k8s-version: [1.27.13, 1.28.9, 1.29.4]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install -g bats@${{ env.BATS_VERSION }}
shell: bash
- run: bats -v
shell: bash
- name: Create Kind Cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
with:
cluster_name: kind
config: test/bats/configs/kind/config.yaml
node_image: kindest/node:v${{ matrix.kind-k8s-version }}
version: ${{ env.KIND_VERSION }}
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: openbao-csi-provider-image
- name: Load openbao-csi-provider dev image
run: docker image load --input ${{ env.TARBALL_FILE }}
- name: bats tests
timeout-minutes: 15
run: DISPLAY_SETUP_TEARDOWN_LOGS=true make e2e-setup e2e-test e2e-teardown