Skip to content

[skip-release] Update github-actions #321

[skip-release] Update github-actions

[skip-release] Update github-actions #321

Workflow file for this run

name: Cloud smoke tests
on:
pull_request:
branches:
- main
permissions:
contents: read
concurrency:
group: cloud-compose-smoke-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
terraform-lint:
name: Terraform lint
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- name: Install contract tools
run: |
sudo apt-get update
sudo apt-get install --yes ripgrep
- name: Install Terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
with:
terraform_version: 1.14.6
terraform_wrapper: false
- name: Install Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.26.x"
cache: false
- name: Run repository lint
run: make lint-check
- name: Validate hosted cleanup retry behavior
run: make hosted-cleanup-retry-contract
config-management-lint:
name: Ansible and Salt lint
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Run Ansible and Salt smoke checks
run: make config-management-smoke
config-management-cloud-smoke:
name: Linode ${{ matrix.method }} Drupal
needs:
- terraform-lint
- config-management-lint
runs-on: ubuntu-24.04
timeout-minutes: 150
if: github.event.pull_request.head.repo.full_name == github.repository
environment: cloud-smoke-linode
strategy:
fail-fast: false
matrix:
method:
- ansible
- salt
concurrency:
group: cloud-compose-config-management-${{ matrix.method }}-drupal
cancel-in-progress: false
env:
CLOUD_COMPOSE_SMOKE_AUTO_APPROVE: "true"
CLOUD_COMPOSE_SMOKE_BOOT_TIMEOUT: "900"
CLOUD_COMPOSE_SMOKE_CONFIG_MANAGEMENT_TIMEOUT: "2400"
CLOUD_COMPOSE_SMOKE_DESTROY_TIMEOUT: "900"
CLOUD_COMPOSE_SMOKE_SWEEP_ORPHANS: "true"
CLOUD_COMPOSE_SMOKE_RUN_ID: ${{ github.run_id }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.26.x"
cache: false
- name: Build provider cloud CI runner
run: make cloud-compose-ci
- name: Install Terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
with:
terraform_version: 1.14.6
terraform_wrapper: false
- name: Run Linode config-management smoke test
timeout-minutes: 100
env:
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
run: make config-management-cloud-smoke METHOD=${{ matrix.method }}
- name: Destroy Linode config-management smoke resources
if: always()
timeout-minutes: 20
env:
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
run: ci/config-management-cloud-smoke.sh destroy-${{ matrix.method }}-drupal
smoke:
name: ${{ matrix.name }}
needs:
- terraform-lint
- config-management-lint
runs-on: ubuntu-24.04
timeout-minutes: 150
if: github.event.pull_request.head.repo.full_name == github.repository
environment: cloud-smoke-${{ matrix.provider }}
strategy:
fail-fast: false
matrix:
include:
- name: DigitalOcean ISLE
provider: digitalocean
template: isle
# Exceed the 90-minute application service ceiling with enough
# room to observe the terminal unit state before cleanup.
boot_timeout: "6000"
- name: DigitalOcean WordPress
provider: digitalocean
template: wp
boot_timeout: "1200"
- name: Linode WordPress
provider: linode
template: wp
boot_timeout: "1200"
concurrency:
group: cloud-compose-smoke-${{ matrix.provider }}-${{ matrix.template }}
cancel-in-progress: false
env:
CLOUD_COMPOSE_SMOKE_AUTO_APPROVE: "true"
CLOUD_COMPOSE_SMOKE_BOOT_TIMEOUT: ${{ matrix.boot_timeout }}
CLOUD_COMPOSE_SMOKE_DESTROY_TIMEOUT: "1800"
CLOUD_COMPOSE_SMOKE_SWEEP_ORPHANS: "true"
CLOUD_COMPOSE_SMOKE_RUN_ID: ${{ github.run_id }}
CLOUD_COMPOSE_SOURCE_REF: ${{ github.sha }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.26.x"
cache: false
- name: Build provider cloud CI runner
run: make cloud-compose-ci
- name: Install Terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
with:
terraform_version: 1.14.6
terraform_wrapper: false
- name: Install sitectl
run: ci/install-sitectl-apt.sh
- name: Run smoke test
env:
DIGITALOCEAN_TOKEN: ${{ matrix.provider == 'digitalocean' && secrets.DIGITALOCEAN_TOKEN || '' }}
LINODE_TOKEN: ${{ matrix.provider == 'linode' && secrets.LINODE_TOKEN || '' }}
run: make smoke-test PROVIDER=${{ matrix.provider }} TEMPLATE=${{ matrix.template }}
- name: Destroy smoke resources
if: always()
env:
DIGITALOCEAN_TOKEN: ${{ matrix.provider == 'digitalocean' && secrets.DIGITALOCEAN_TOKEN || '' }}
LINODE_TOKEN: ${{ matrix.provider == 'linode' && secrets.LINODE_TOKEN || '' }}
run: ci/cloud-smoke.sh destroy-${{ matrix.provider }}-${{ matrix.template }}
gcp-smoke:
name: GCP WordPress
needs:
- terraform-lint
- config-management-lint
runs-on: ubuntu-24.04
timeout-minutes: 210
if: github.event.pull_request.head.repo.full_name == github.repository
environment: cloud-smoke-gcp
permissions:
contents: read
id-token: write
concurrency:
group: cloud-compose-smoke-gcp-wp
cancel-in-progress: false
env:
CLOUD_COMPOSE_SMOKE_AUTO_APPROVE: "true"
CLOUD_COMPOSE_SMOKE_DESTROY_TIMEOUT: "1800"
CLOUD_COMPOSE_SMOKE_SWEEP_ORPHANS: "true"
CLOUD_COMPOSE_SMOKE_RUN_ID: ${{ github.run_id }}
CLOUD_COMPOSE_SOURCE_REF: ${{ github.sha }}
CLOUD_COMPOSE_UPGRADE_BASE_SHA: f33117cdbbf4a9c7d59006a4db986baef118e6bb
CLOUD_COMPOSE_UPGRADE_CURRENT_REF: ${{ github.sha }}
GCLOUD_OIDC_POOL: ${{ vars.GCLOUD_OIDC_POOL || secrets.GCLOUD_OIDC_POOL }}
GCLOUD_PROJECT: ${{ vars.GCLOUD_PROJECT || secrets.GCLOUD_PROJECT }}
GCLOUD_FRESH_REGION: ${{ vars.GCLOUD_FRESH_REGION || secrets.GCLOUD_FRESH_REGION }}
GCLOUD_FRESH_ZONE: ${{ vars.GCLOUD_FRESH_ZONE || secrets.GCLOUD_FRESH_ZONE }}
GCLOUD_REGION: ${{ vars.GCLOUD_REGION || secrets.GCLOUD_REGION }}
GCLOUD_ZONE: ${{ vars.GCLOUD_ZONE || secrets.GCLOUD_ZONE }}
GCLOUD_NETWORK_PROJECT_ID: ${{ vars.GCLOUD_NETWORK_PROJECT_ID || secrets.GCLOUD_NETWORK_PROJECT_ID }}
GCLOUD_NETWORK_NAME: ${{ vars.GCLOUD_NETWORK_NAME || secrets.GCLOUD_NETWORK_NAME }}
GCLOUD_SUBNETWORK_NAME: ${{ vars.GCLOUD_SUBNETWORK_NAME || secrets.GCLOUD_SUBNETWORK_NAME }}
GCLOUD_POWER_START_ROLE: ${{ vars.GCLOUD_POWER_START_ROLE || secrets.GCLOUD_POWER_START_ROLE }}
GCLOUD_POWER_SUSPEND_ROLE: ${{ vars.GCLOUD_POWER_SUSPEND_ROLE || secrets.GCLOUD_POWER_SUSPEND_ROLE }}
GSA: ${{ vars.GSA || secrets.GSA }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- name: Install Terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
with:
terraform_version: 1.14.6
terraform_wrapper: false
- name: Install Go for cloud CI runner
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.26.x"
cache: false
- name: Build cloud CI runner
run: make cloud-compose-ci
- name: Check GCP smoke configuration
run: |
test -n "$GCLOUD_OIDC_POOL" || { echo "GCLOUD_OIDC_POOL environment variable or secret is required for GCP smoke tests"; exit 1; }
test -n "$GSA" || { echo "GSA environment variable or secret is required for GCP smoke tests"; exit 1; }
test -n "$GCLOUD_PROJECT" || { echo "GCLOUD_PROJECT environment variable or secret is required for GCP smoke tests"; exit 1; }
- name: Check GCP upgrade configuration
if: ${{ startsWith(github.event.pull_request.title, '[major]') }}
run: |
test -n "$GCLOUD_NETWORK_PROJECT_ID" || { echo "GCLOUD_NETWORK_PROJECT_ID environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
test -n "$GCLOUD_NETWORK_NAME" || { echo "GCLOUD_NETWORK_NAME environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
test -n "$GCLOUD_SUBNETWORK_NAME" || { echo "GCLOUD_SUBNETWORK_NAME environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
test -n "$GCLOUD_POWER_START_ROLE" || { echo "GCLOUD_POWER_START_ROLE environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
test -n "$GCLOUD_POWER_SUSPEND_ROLE" || { echo "GCLOUD_POWER_SUSPEND_ROLE environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
test "$GCLOUD_NETWORK_PROJECT_ID" = "$GCLOUD_PROJECT" || { echo "GCLOUD_NETWORK_PROJECT_ID must equal GCLOUD_PROJECT for the 0.10.2 baseline"; exit 1; }
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
with:
workload_identity_provider: ${{ env.GCLOUD_OIDC_POOL }}
service_account: ${{ env.GSA }}
project_id: ${{ env.GCLOUD_PROJECT }}
- name: Install gcloud
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3
- name: Install sitectl
run: ci/install-sitectl-apt.sh
- name: Run fresh smoke test
if: ${{ !startsWith(github.event.pull_request.title, '[major]') }}
env:
GCLOUD_REGION: ${{ vars.GCLOUD_FRESH_REGION || secrets.GCLOUD_FRESH_REGION || vars.GCLOUD_REGION || secrets.GCLOUD_REGION }}
GCLOUD_ZONE: ${{ vars.GCLOUD_FRESH_ZONE || secrets.GCLOUD_FRESH_ZONE || vars.GCLOUD_ZONE || secrets.GCLOUD_ZONE }}
run: make smoke-test PROVIDER=gcp TEMPLATE=wp
- name: Run 0.10.2 upgrade smoke test
if: ${{ startsWith(github.event.pull_request.title, '[major]') }}
run: ci/gcp-upgrade-smoke.sh run
- name: Destroy fresh smoke resources
if: ${{ always() && !startsWith(github.event.pull_request.title, '[major]') && env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != '' }}
env:
GCLOUD_REGION: ${{ vars.GCLOUD_FRESH_REGION || secrets.GCLOUD_FRESH_REGION || vars.GCLOUD_REGION || secrets.GCLOUD_REGION }}
GCLOUD_ZONE: ${{ vars.GCLOUD_FRESH_ZONE || secrets.GCLOUD_FRESH_ZONE || vars.GCLOUD_ZONE || secrets.GCLOUD_ZONE }}
run: ci/cloud-smoke.sh destroy-gcp-wp
- name: Destroy upgrade smoke resources
if: ${{ always() && startsWith(github.event.pull_request.title, '[major]') && env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != '' && env.GCLOUD_NETWORK_PROJECT_ID != '' && env.GCLOUD_NETWORK_NAME != '' && env.GCLOUD_SUBNETWORK_NAME != '' }}
run: ci/gcp-upgrade-smoke.sh destroy