-
Notifications
You must be signed in to change notification settings - Fork 15
55 lines (51 loc) · 1.53 KB
/
ci.yml
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
name: CI
on:
pull_request:
types: [opened, synchronize]
env:
ENV0_API_ENDPOINT: ${{ secrets.ENV0_API_ENDPOINT }}
ENV0_API_KEY: ${{ secrets.TF_PROVIDER_INTEGRATION_TEST_API_KEY }} # API Key for organization 'TF-provider-integration-tests' @ dev
ENV0_API_SECRET: ${{ secrets.TF_PROVIDER_INTEGRATION_TEST_API_SECRET }}
GO_VERSION: "1.23"
TERRAFORM_VERSION: 1.1.7
jobs:
unit-tests:
name: Unit Tests
timeout-minutes: 10
runs-on: ubuntu-20.04
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v4
- name: Generate mocks
run: |
go install go.uber.org/mock/[email protected]
go generate client/api_client.go
- name: Go fmt
run: |
! go fmt ./... | read
- name: Go vet
run: |
! go vet ./... | read
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
- name: Go Test
run: go test -v ./...
# See terraform-provider-env0 README for integration tests prerequisites
integration-tests:
name: Integration Tests
runs-on: ubuntu-20.04
container: golang:1.23-alpine
timeout-minutes: 20
steps:
- name: Install Opentofu
run: apk add opentofu
- name: Checkout code
uses: actions/checkout@v4
- name: Run Harness tests
run: go run tests/harness.go