-
Notifications
You must be signed in to change notification settings - Fork 21
115 lines (112 loc) · 3.66 KB
/
pr.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
on:
pull_request:
paths-ignore:
- 'CHANGELOG.md'
- 'CHANGELOG_PENDING.md'
push:
branches:
- main
tags:
- sdk/v*.*.*
paths-ignore:
- 'CHANGELOG.md'
- 'CHANGELOG_PENDING.md'
repository_dispatch:
types:
- run-acceptance-tests-command
# TODO[pulumi/java#10] protect jobs from crypto mining PR attacks
# before making the repo public.
env:
PULUMI_API: https://api.pulumi-staging.io
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
AWS_REGION: us-west-2
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOGLE_CI_SERVICE_ACCOUNT_EMAIL: pulumi-ci@pulumi-ci-gcp-provider.iam.gserviceaccount.com
GOOGLE_CI_WORKLOAD_IDENTITY_POOL: pulumi-ci
GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER: pulumi-ci
GOOGLE_PROJECT_NUMBER: 895284651812
GOLANGCI_LINT_VERSION: v1.60.3
jobs:
prerequisites:
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
gotcloudcreds: ${{ steps.gotcloudcreds.outputs.gotcloudcreds }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Fetch Tags
run: git fetch --quiet --prune --unshallow --tags
- name: Install Pulumi CLI
uses: pulumi/actions@v6
with:
pulumi-version: latest
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@v1.14.0
with:
repo: pulumi/pulumictl
tag: v0.0.31
cache: enable
- run: ./scripts/versions.sh | tee versions.txt
- name: Setup versioning env vars
run: cat versions.txt | tee $GITHUB_ENV
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Configure Go cache
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> "$GITHUB_OUTPUT"
echo "go-mod=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT"
- name: Set up Go cache
uses: actions/cache@v4
id: go-cache
with:
path: |
${{ steps.go-cache-paths.outputs.go-build }}
${{ steps.go-cache-paths.outputs.go-mod }}
key: go-cache-${{ hashFiles('**/go.sum') }}
- name: Build and unit-test Pulumi Java SDK
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629
with:
arguments: build
build-root-directory: sdk/java
- run: make build_go
- run: make bin/pulumi-java-gen
- run: make bin/pulumi-language-java
- uses: actions/upload-artifact@v4
with:
name: versions.txt
path: versions.txt
- uses: actions/upload-artifact@v4
with:
name: go-binaries
path: bin/
- name: Publish Pulumi Java SDK to Maven Local
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629
with:
arguments: publishToMavenLocal
build-root-directory: sdk/java
- uses: actions/upload-artifact@v4
with:
name: java-sdk
path: ~/.m2/repository/com/pulumi
- name: Check whether cloud creds for test envs are available
id: gotcloudcreds
env:
KEY: ${{ secrets.AWS_ACCESS_KEY_ID }}
run: |
echo "Enable testing against cloud environments: ${{ env.KEY != '' }}"
echo "gotcloudcreds=${{ env.KEY != '' }}" >> "$GITHUB_OUTPUT"
strategy:
fail-fast: true