forked from hashicorp/terraform-provider-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (61 loc) · 2.01 KB
/
test.yml
File metadata and controls
69 lines (61 loc) · 2.01 KB
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
name: Acceptance Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
get_version_matrix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: get_version_matrix
shell: bash
run: scripts/get-version-matrix.sh
outputs:
version_matrix: ${{ steps.get_version_matrix.outputs.matrix }}
acc_test:
needs: get_version_matrix
runs-on: ubuntu-latest
strategy:
matrix:
terraform_version: ${{ fromJson(needs.get_version_matrix.outputs.version_matrix) }}
steps:
- uses: actions/checkout@main
# TODO: simulate today's `make testacc` command by modifying makefile.
# We'll have to do this in two steps: 1. Pre-test setup, and 2. 'go test', which
# is run by gotestsum. Unfortunately, the `go test` command must be run by gotestsum.
- name: Acceptance Tests
env:
KUBE_CONFIG_PATH: "${HOME}/.kube/config"
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform_version }}
TF_ACC: true
GOROOT: ${{ env.GOROOT_1_16_X64 }}
run: |
go version
which go
go install github.com/gotestyourself/gotestsum@v1.6.4
minikube start
gotestsum --junitfile test-results.xml
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Results (Terraform ${{ matrix.terraform-version }})
path: test-results.xml
publish-test-results:
name: "Publish Tests Results"
needs: acc_test
runs-on: ubuntu-latest
# This will skip uploading test results if the acceptance tests were skipped.
if: success() || failure()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@2c1638db7746f235576536a706b83d2eece7f413
with:
files: artifacts/**/*.xml