|
1 |
| -name: Test |
2 |
| - |
| 1 | +name: Tests |
3 | 2 | on:
|
4 | 3 | pull_request:
|
5 | 4 | branches: [ main ]
|
|
13 | 12 | - 'README.md'
|
14 | 13 | - 'CHANGELOG.md'
|
15 | 14 | - 'website/*'
|
16 |
| - |
17 | 15 | jobs:
|
18 | 16 | build:
|
19 | 17 | name: Build
|
20 | 18 | runs-on: ubuntu-latest
|
21 | 19 | timeout-minutes: 5
|
22 | 20 | steps:
|
23 | 21 |
|
24 |
| - - name: Set up Go |
25 |
| - uses: actions/setup-go@v3 |
26 |
| - with: |
27 |
| - go-version: '1.18' |
28 |
| - id: go |
29 |
| - |
30 | 22 | - name: Check out code into the Go module directory
|
31 |
| - uses: actions/checkout@v3 |
| 23 | + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
32 | 24 |
|
33 |
| - - name: Run linters |
34 |
| - uses: golangci/golangci-lint-action@v3 |
| 25 | + - name: Set up Go |
| 26 | + uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 |
35 | 27 | with:
|
36 |
| - version: latest |
| 28 | + go-version-file: 'go.mod' |
| 29 | + id: go |
37 | 30 |
|
38 |
| - - name: Generate |
39 |
| - run: make generate |
| 31 | + - name: Go fmt |
| 32 | + run: | |
| 33 | + make fmt |
40 | 34 |
|
41 |
| - - name: Confirm no diff |
| 35 | + - name: Go vet |
42 | 36 | run: |
|
43 |
| - git diff --compact-summary --exit-code || \ |
44 |
| - (echo "*** Unexpected differences after code generation. Run 'make generate' and commit."; exit 1) |
| 37 | + make vet |
45 | 38 |
|
46 | 39 | - name: Build
|
47 |
| - run: make build |
| 40 | + run: | |
| 41 | + go build -v . |
| 42 | + |
48 | 43 |
|
| 44 | + # run acceptance tests in a matrix with Terraform core versions |
49 | 45 | test:
|
50 |
| - name: 'Acc. Tests (OS: ${{ matrix.os }} / TF: ${{ matrix.terraform }})' |
| 46 | + name: Matrix Test |
51 | 47 | needs: build
|
52 | 48 | runs-on: ${{ matrix.os }}
|
53 | 49 | timeout-minutes: 15
|
54 | 50 | strategy:
|
55 | 51 | fail-fast: false
|
56 | 52 | matrix:
|
57 |
| - os: |
58 |
| - - macos-latest |
59 |
| - - windows-latest |
60 |
| - - ubuntu-latest |
| 53 | + os: [macos-latest, windows-latest, ubuntu-latest] |
61 | 54 | terraform:
|
62 |
| - - '0.12.*' |
63 |
| - - '0.13.*' |
64 |
| - - '0.14.*' |
65 |
| - - '0.15.*' |
66 |
| - - '1.0.*' |
67 |
| - - '1.1.*' |
68 |
| - - '1.2.*' |
69 |
| - - '1.3.*' |
| 55 | + - '0.12.31' |
| 56 | + - '0.13.7' |
| 57 | + - '0.14.11' |
| 58 | + - '0.15.1' |
70 | 59 | steps:
|
71 | 60 |
|
72 |
| - - name: Setup Go |
73 |
| - uses: actions/setup-go@v3 |
74 |
| - with: |
75 |
| - go-version: '1.18' |
76 |
| - check-latest: true |
77 |
| - |
78 |
| - - name: Check out code |
79 |
| - uses: actions/checkout@v3 |
| 61 | + - name: Check out code into the Go module directory |
| 62 | + uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 |
80 | 63 |
|
81 |
| - - name: Setup Terraform ${{ matrix.terraform }} |
82 |
| - uses: hashicorp/setup-terraform@v2 |
| 64 | + - name: Set up Go |
| 65 | + uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 |
83 | 66 | with:
|
84 |
| - terraform_version: ${{ matrix.terraform }} |
85 |
| - terraform_wrapper: false |
| 67 | + go-version-file: 'go.mod' |
| 68 | + id: go |
86 | 69 |
|
87 |
| - - name: Run acceptance test |
88 |
| - run: make testacc |
| 70 | + - name: TF acceptance tests |
| 71 | + timeout-minutes: 10 |
| 72 | + env: |
| 73 | + TF_ACC: "1" |
| 74 | + TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }} |
| 75 | + run: | |
| 76 | + go test -v -cover ./internal/provider/ |
0 commit comments