Draft: blog linting rules #365
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Run Example Code Tests" | |
on: | |
schedule: | |
- cron: "0 8 * * *" | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: {} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} | |
AWS_REGION: "us-west-2" | |
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} | |
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} | |
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} | |
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: pulumi-ci-gcp-provider | |
GOOGLE_PROJECT_NUMBER: 895284651812 | |
jobs: | |
test: | |
runs-on: ${{ matrix.platform }} | |
permissions: | |
contents: read | |
id-token: write | |
strategy: | |
matrix: | |
platform: | |
- pulumi-service-ubuntu-22.04-16core | |
go-version: | |
- 1.21.x | |
node-version: | |
- 18.x | |
python-version: | |
- 3.8 | |
dotnet-version: | |
- 6.0.x | |
java-version: | |
- 11 | |
steps: | |
- name: Install Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Install Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: ${{ matrix.java-version }} | |
- name: Install DotNet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install Hugo | |
uses: peaceiris/actions-hugo@v2 | |
with: | |
hugo-version: "0.135.0" | |
extended: true | |
- name: Install Pulumi | |
uses: pulumi/actions@v4 | |
- name: Check out the code | |
uses: actions/checkout@v3 | |
- name: Fetch master branch | |
run: git fetch origin master:master | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-region: ${{ env.AWS_REGION }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
role-duration-seconds: 14400 # 4 hours | |
role-session-name: pulumi-docs-examples@githubActions | |
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER }}/locations/global/workloadIdentityPools/${{ env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} | |
- name: Run the tests | |
run: make test | |
env: | |
TEST_MODE: ${{ github.event_name }} | |
notify: | |
# Only send slack notifications for failures during scheduled cron runs. | |
if: (failure() && github.event_name == 'schedule') | |
name: Send slack notification | |
runs-on: ubuntu-latest | |
needs: [test] | |
steps: | |
- name: Slack Notification | |
uses: docker://sholung/action-slack-notify:v2.3.0 | |
env: | |
SLACK_CHANNEL: docs-ops | |
SLACK_COLOR: "#F54242" | |
SLACK_MESSAGE: "Failing code example tests in `pulumi/docs` :meow_sad:" | |
SLACK_USERNAME: docsbot | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} | |
SLACK_ICON: https://www.pulumi.com/logos/brand/avatar-on-white.png |