mirror of https://github.com/pulumi/pulumi.git
95 lines
3.4 KiB
YAML
95 lines
3.4 KiB
YAML
name: Downstream Codegen Tests
|
|
on:
|
|
repository_dispatch:
|
|
types: [ run-codegen-command ]
|
|
pull_request:
|
|
paths:
|
|
- 'pkg/codegen/**'
|
|
- '!pkg/codegen/docs/**'
|
|
- '.github/workflows/run-codegen-test.yml'
|
|
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }}
|
|
|
|
jobs:
|
|
comment-notification:
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'repository_dispatch'
|
|
steps:
|
|
- name: Create URL to the run output
|
|
id: vars
|
|
run: echo ::set-output name=run-url::$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
|
|
- name: Update with Result
|
|
uses: peter-evans/create-or-update-comment@v2
|
|
with:
|
|
token: ${{ secrets.PULUMI_BOT_TOKEN }}
|
|
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
|
|
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
|
|
issue-number: ${{ github.event.client_payload.github.payload.issue.number }}
|
|
body: |
|
|
Please view the results of the Downstream Codegen Tests [Here][1]
|
|
|
|
[1]: ${{ steps.vars.outputs.run-url }}
|
|
comment-notification-pr:
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'pull_request'
|
|
steps:
|
|
- name: Create URL to the run output
|
|
id: vars
|
|
run: echo ::set-output name=run-url::$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
|
|
- name: Update with Result
|
|
uses: peter-evans/create-or-update-comment@v2
|
|
with:
|
|
token: ${{ secrets.PULUMI_BOT_TOKEN }}
|
|
issue-number: ${{ github.event.pull_request.number }}
|
|
body: |
|
|
Please view the results of the Downstream Codegen Tests [Here][1]
|
|
|
|
[1]: ${{ steps.vars.outputs.run-url }}
|
|
downstream-test:
|
|
name: Test ${{ matrix.provider }} Downstream
|
|
if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
provider: ["aws", "gcp", "azure", "azuread", "random", "kubernetes"]
|
|
fail-fast: false
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.18.x
|
|
check-latest: true
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '14.x'
|
|
- name: Install Python
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: 3.9.x
|
|
- name: Install Pulumi CLI
|
|
uses: pulumi/action-install-pulumi-cli@v1.0.1
|
|
- name: Install pulumictl
|
|
uses: jaxxstorm/action-install-gh-release@v1.7.1
|
|
with:
|
|
repo: pulumi/pulumictl
|
|
tag: v0.0.31
|
|
cache: enable
|
|
- name: Check out source code
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ env.PR_COMMIT_SHA }}
|
|
- name: Test Downstream
|
|
uses: pulumi/action-test-provider-downstream@v1.0.0
|
|
env:
|
|
GOPROXY: "https://proxy.golang.org"
|
|
with:
|
|
GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }}
|
|
replacements: github.com/pulumi/pulumi/pkg/v3=pulumi/pkg,github.com/pulumi/pulumi/sdk/v3=pulumi/sdk
|
|
downstream-name: pulumi-${{ matrix.provider }}
|
|
downstream-url: https://github.com/pulumi/pulumi-${{ matrix.provider }}
|
|
use-provider-dir: true
|
|
issue-number: ${{ github.event.client_payload.github.payload.issue.number }}
|