Skip to content

Update the webhooks format description #382

Update the webhooks format description

Update the webhooks format description #382

name: Build and run tests
on:
push:
branches:
- main
tags-ignore:
- v*
- sdk/*
- '**'
pull_request:
branches:
- main
paths_ignore:
- CHANGELOG.md
repository_dispatch:
types:
- run-acceptance-tests-command
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
PULUMI_BACKEND_URL: https://api.pulumi-staging.io
# Required to properly write "go mod edit -replace=.." when running go examples
PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/..
PROVIDER: pulumiservice
# Need to pin this as 0.8.0 until codegen is updated
PULUMI_JAVA_SDK_VERSION: 0.8.0
# Lookup nuget packages from this directory as well as default nuget directories
PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget
PULUMI_TEST_OWNER: service-provider-test-org
PULUMI_TEST_USE_SERVICE: true
jobs:
build_sdks:
if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
name: build_sdks
runs-on: ubuntu-latest
needs: prerequisites
strategy:
fail-fast: true
matrix:
dotnetversion: [ 3.1.301 ]
goversion: [ 1.19.x ]
language: [ nodejs, python, dotnet, go, java ]
nodeversion: [ 14.x ]
pythonversion: [ 3.7 ]
javaversion: [ 11 ]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Checkout Scripts Repo
uses: actions/checkout@v3
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}
cache-dependency-path: sdk/go.sum
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{matrix.nodeversion}}
registry-url: https://registry.npmjs.org
- name: Setup DotNet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{matrix.dotnetversion}}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.pythonversion}}
- name: Set up JDK 11
uses: actions/setup-java@v3
if: ${{ matrix.language == 'java' }}
with:
java-version: ${{matrix.javaversion}}
distribution: 'adopt'
cache: 'gradle'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
if: ${{ matrix.language == 'java' }}
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v4
- name: Download provider + tfgen binaries
uses: actions/download-artifact@v3
with:
name: pulumi-${{ env.PROVIDER }}
path: ${{ github.workspace }}/bin
- name: Restore binary perms
run: find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print
-exec chmod +x {} \;
- name: Generate SDK
run: make ${{ matrix.language }}_sdk
- name: Check worktree clean
run: ./ci-scripts/ci/check-worktree-is-clean
- run: git status --porcelain
- name: Compress SDK folder
run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} .
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz
prerequisites:
name: prerequisites
runs-on: ubuntu-latest
strategy:
matrix:
goversion: [1.19.x]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
lfs: true
- name: Checkout Scripts Repo
uses: actions/checkout@v3
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}
cache-dependency-path: examples/go.sum
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v4
- name: Build codegen binaries
run: make gen
- name: Build provider binary
run: make provider
- name: Check worktree clean
run: ./ci-scripts/ci/check-worktree-is-clean
- run: git status --porcelain
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: pulumi-${{ env.PROVIDER }}
path: ${{ github.workspace }}/bin
- name: Test Provider Library
run: make test_provider
test:
name: ${{ matrix.language }} Tests
needs: build_sdks
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
language: [nodejs, java, yaml, go, dotnet, python]
dotnetversion: [3.1.301]
goversion: [1.19.x]
nodeversion: [14.x]
pythonversion: [3.7]
javaversion: [11]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Checkout Scripts Repo
uses: actions/checkout@v3
with:
path: ci-scripts
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.goversion }}
cache-dependency-path: examples/go.sum
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/actions@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{matrix.nodeversion}}
registry-url: https://registry.npmjs.org
- name: Setup DotNet
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{matrix.dotnetversion}}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{matrix.pythonversion}}
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: pulumi-${{ env.PROVIDER }}
path: ${{ github.workspace }}/bin
- name: Restore binary perms
run: find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print
-exec chmod +x {} \;
- name: Download SDK
if: ${{ matrix.language != 'yaml' }}
uses: actions/download-artifact@v3
with:
name: ${{ matrix.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk
- name: Uncompress SDK folder
if: ${{ matrix.language != 'yaml' }}
run: tar -zxf ${{ github.workspace}}/sdk/${{ matrix.language}}.tar.gz -C ${{ github.workspace}}/sdk/${{ matrix.language}}
- name: Update path
run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Install Node deps
run: yarn global add typescript
- run: dotnet nuget add source ${{ github.workspace }}/nuget
- name: Install Python deps
run: |-
pip3 install virtualenv==20.0.23
pip3 install pipenv
- name: Install dependencies
if: ${{ matrix.language != 'yaml' }}
run: make install_${{ matrix.language}}_sdk
- name: Set up gotestfmt
uses: haveyoudebuggedit/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
set -euo pipefail
cd examples && go test -json -v -count=1 -cover -timeout 2h -tags=${{ matrix.language
}} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt