-
Notifications
You must be signed in to change notification settings - Fork 45
88 lines (81 loc) · 2.33 KB
/
lint-build.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
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
88
name: Lint and Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- uses: actions/setup-go@v2
with:
go-version: 1.17
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --show-diff-on-failure
test:
name: Acceptance Tests
# Secrets (sandbox token) are not available on forks
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Test with apikey
env:
GANDI_URL: https://api.sandbox.gandi.net
GANDI_KEY: ${{ secrets.GANDI_SANDBOX_KEY }}
GANDI_SHARING_ID: a2f9c3dc-ab0e-11ee-b064-00163e6722b2
run: |
make testacc
- name: Test with personal access token
env:
GANDI_URL: https://api.sandbox.gandi.net
GANDI_PERSONAL_ACCESS_TOKEN: ${{ secrets.GANDI_SANDBOX_PERSONAL_ACCESS_TOKEN }}
run: |
make testacc
build:
name: Build
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
include:
- os: ubuntu-latest
asset_name: terraform-provider-gandi-linux_amd64
- os: macos-latest
asset_name: terraform-provider-gandi-darwin_amd64
- os: windows-latest
asset_name: terraform-provider-gandi-windows_amd64
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build
run: |
make cibuild
# This still does something weird, comment out for now
# - name: TF Provider Lint
# uses: bflad/tfproviderlint-github-action@master
# if: runner.os == 'Linux'
# with:
# args: "./..."
- uses: actions/upload-artifact@v2
name: Upload
with:
name: build-artifact
path: ${{ matrix.asset_name }}