-
Notifications
You must be signed in to change notification settings - Fork 2
187 lines (180 loc) · 5.88 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# This workflow will build and test the Chronosphere provider
name: pulumi-chronosphere
on:
push:
branches: main
pull_request:
# The specific activity types are listed here to include "labeled" and "unlabeled"
# (which are not included by default for the "pull_request" trigger).
# This is needed to allow skipping enforcement of the changelog in PRs with specific labels,
# as defined in the (optional) "skipLabels" property.
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
env:
DOTNETVERSION: |
6.0.x
3.1.301
GOVERSION: 1.21.x
GRADLEVERSION: "7.6"
JAVAVERSION: "11"
NODEVERSION: 20.x
PYTHONVERSION: "3.12.2"
jobs:
# Enforces the update of a changelog file on every pull request
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dangoslen/changelog-enforcer@v3
with:
skipLabels: "skip-changelog,ignore-release"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21
cache: false
# This step is performed because we some of the go:embed files are generated. However, we
# can lint the code without having to do a full build/generate cycle. Therefore we
# just make them do nothing.
- name: disarm go:embed directives to enable lint
continue-on-error: true # this fails if there are no go:embed directives
run: |
git grep -l 'go:embed' -- provider | xargs sed -i 's/go:embed/ goembed/g'
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.55.2
working-directory: provider
args: -c ../.golangci.yml
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21
cache: false
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
tag: v0.0.46
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v5
with:
pulumi-version: ^3
- name: Test Provider
run: make provider test_provider
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21
cache: false
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
tag: v0.0.46
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v5
with:
pulumi-version: ^3
- if: matrix.language == 'nodejs'
name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODEVERSION }}
registry-url: https://registry.npmjs.org
- if: matrix.language == 'dotnet'
name: Setup DotNet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNETVERSION }}
- if: matrix.language == 'python'
name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHONVERSION }}
- if: matrix.language == 'java'
name: Setup Java
uses: actions/setup-java@v4
with:
cache: gradle
distribution: temurin
java-version: ${{ env.JAVAVERSION }}
- if: matrix.language == 'java'
name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: ${{ env.GRADLEVERSION }}
- name: Build SDK
run: make provider build_${{ matrix.language }}
- name: Check generated code is up to date
run: ./scripts/check_for_diffs.sh
strategy:
fail-fast: true
matrix:
language:
- nodejs
- dotnet
- java
- python
- go
# - name: Download provider + tfgen binaries
# uses: actions/download-artifact@v4
# with:
# name: ${{ env.PROVIDER }}-provider.tar.gz
# path: ${{ github.workspace }}/bin
# - name: Untar provider binaries
# run: >-
# tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{
# github.workspace}}/bin
# find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \;
# - name: Install plugins
# run: make install_plugins
# - name: Update path
# run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
# - name: Set PACKAGE_VERSION to Env
# run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >>
# "$GITHUB_ENV"
# - name: Build SDK
# run: make build_${{ matrix.language }}
# - name: Check worktree clean
# run: ./ci-scripts/ci/check-worktree-is-clean
# - name: Compress SDK folder
# run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.language }}-sdk.tar.gz
# path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz
# retention-days: 30
# - if: failure() && github.event_name == 'push'
# name: Notify Slack
# uses: 8398a7/action-slack@v3
# with:
# author_name: Failure in building ${{ matrix.language }} sdk
# fields: repo,commit,author,action
# status: ${{ job.status }}
# strategy:
# fail-fast: true
# matrix:
# language:
# - nodejs
# - python
# - dotnet
# - go
# - java