-
Notifications
You must be signed in to change notification settings - Fork 11
137 lines (133 loc) · 4.3 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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Continuous Integration
on:
push:
branches: [master]
paths-ignore:
- 'README.md'
pull_request:
branches: [master]
defaults:
run:
shell: bash
env:
PYTHON_DEFAULT_VERSION: '3.12'
GO_DEFAULT_VERSION: '1.22'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }}
uses: actions/[email protected]
with:
go-version: ${{ env.GO_DEFAULT_VERSION }}
- name: Install dependencies
run: |
make deps
- name: Run dependency checker
run: |
make deps-check
- name: Run linters
run: |
make lint
- name: Run docs linters
run: |
make docs-lint
- name: Validate changelog
# Library was designed to be used with pull requests only.
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
uses: zattoo/changelog@v1
with:
token: ${{ github.token }}
build:
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-12 # amd64
- macos-14 # arm64
- windows-2019
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} (ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
uses: deadsnakes/[email protected]
with:
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }}
if: matrix.os != 'ubuntu-latest'
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_DEFAULT_VERSION }}
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }}
uses: actions/[email protected]
with:
go-version: ${{ env.GO_DEFAULT_VERSION }}
- name: Install dependencies
run: |
make deps
- name: Build the provider
run: |
make build
- name: Upload python bindings
uses: actions/upload-artifact@v2
with:
name: py-terraform-provider-b2-${{ runner.os }}-${{ runner.arch }}
path: python-bindings/dist/py-terraform-provider-b2
if-no-files-found: error
retention-days: 1
test:
needs: build
env:
B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }}
B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }}
NOPYBINDINGS: 1 # do not build python buildings
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-12 # amd64
- macos-14 # arm64
- windows-2019
terraform:
- '1.5.*'
- '1.4.*'
exclude:
- os: macos-12 # for macOS, the latest terraform is enough for ACC tests
terraform: '1.4.*'
- os: macos-14 # for macOS, the latest terraform is enough for ACC tests
terraform: '1.4.*'
- os: windows-2019 # for Windows, the latest terraform is enough for ACC tests
terraform: '1.4.*'
steps:
- uses: actions/checkout@v2
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }}
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }}
uses: actions/[email protected]
with:
go-version: ${{ env.GO_DEFAULT_VERSION }}
- uses: hashicorp/setup-terraform@v2
name: Set up Terraform ${{ matrix.terraform }}
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false
- name: Download python bindings for given OS
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }}
uses: actions/download-artifact@v2
with:
name: py-terraform-provider-b2-${{ runner.os }}-${{ runner.arch }}
path: python-bindings/dist/
- name: Run acceptance tests
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }}
timeout-minutes: 120
run: |
make testacc