pulumi/.github/workflows/run-build-and-integration-t...

100 lines
3.4 KiB
YAML

on:
repository_dispatch:
types: [ run-integration-tests-command ]
defaults:
run:
shell: bash
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULUMI_TEST_OWNER: "moolumi"
PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }}
PYTHON: python
DOTNET_CLI_TELEMETRY_OPTOUT: "true"
# Cancel checks on prior commits when new commits are added to a PR.
# This is motivated by temporary throughput issues on our GitHub
# Actions workers availability.
#
# Note from GitHub docs: Concurrency is currently in beta and subject
# to change.
#
# See also: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
#
# Note on the the `group` computed expression: it is compiling
# `github.head_ref == '' ? github.run_id : github.head_ref` expression
# to the primitives available in GitHub Actions. The idea to use
# `head_ref` on `pull_request` triggers, but use unique
# `github.run_id` on `run-integration-tests-command` triggers. This
# effectively disables `concurrency` checks for
# `run-integration-tests-command` triggers.
concurrency:
group: run-build-integration-tests-${{(fromJSON(format('[{0},{1}]',toJSON(github.head_ref),toJSON(github.run_id))))[github.head_ref=='']}}
cancel-in-progress: true
jobs:
comment-notification:
# We only care about adding the result to the PR if it's a repository_dispatch event
if: github.event_name == 'repository_dispatch'
runs-on: ubuntu-latest
steps:
- name: Create URL to the run output
id: vars
run: echo ::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID
- name: Update with Result
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
issue-number: ${{ github.event.client_payload.github.payload.issue.number }}
body: |
Please view the results of the PR Build + Integration Tests Run [Here][1]
[1]: ${{ steps.vars.outputs.run-url }}
versions:
name: Versions
uses: ./.github/workflows/versions.yml
build:
name: Build
uses: ./.github/workflows/build.yml
needs: versions
with:
enable-coverage: true
goreleaser-flags: -p 3 --skip-validate
test-linux:
name: Test Linux
needs: build
uses: ./.github/workflows/test.yml
if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
with:
enable-coverage: true
platform: ubuntu-latest
secrets:
pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }}
test-macos:
name: Test MacOS
needs: build
uses: ./.github/workflows/test.yml
if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
with:
enable-coverage: true
platform: macos-latest
secrets:
pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }}
test-windows:
name: Test Windows
needs: build
uses: ./.github/workflows/test.yml
if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
with:
enable-coverage: true
platform: windows-latest
secrets:
pulumi-access-token: ${{ secrets.PULUMI_PROD_ACCESS_TOKEN }}