Skip to content

chore: regenerate containerprovisioner worker mocks #1083

chore: regenerate containerprovisioner worker mocks

chore: regenerate containerprovisioner worker mocks #1083

Workflow file for this run

# This workflow examines the changed files
# and runs tests depending on what files have changed.
name: "Checks"
on:
push:
branches: [3.*, 4.*, main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
merge_group:
permissions:
contents: read
pull-requests: read
jobs:
changed-files:
name: "Collate changed files"
runs-on: ubuntu-latest
outputs:
check-build: ${{ steps.filter-files.outputs.check-build }}
check-client: ${{ steps.filter-files.outputs.check-client }}
check-unit-tests: ${{ steps.filter-files.outputs.check-unit-tests }}
check-migrate: ${{ steps.filter-files.outputs.check-migrate }}
check-upgrade: ${{ steps.filter-files.outputs.check-upgrade }}
check-terraform: ${{ steps.filter-files.outputs.check-terraform }}
check-snap: ${{ steps.filter-files.outputs.check-snap }}
check-generate: ${{ steps.filter-files.outputs.check-generate }}
check-docs: ${{ steps.filter-files.outputs.check-docs }}
check-ddl: ${{ steps.filter-files.outputs.check-ddl }}
check-smoke: ${{ steps.filter-files.outputs.check-smoke }}
ref: ${{ steps.refs.outputs.head_ref }}
base: ${{ steps.refs.outputs.base_ref }}
steps:
- name: Checkout
if: github.event_name != 'pull_request'
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Calculate Refs
id: refs
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "head_ref=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
echo "base_ref=${{ github.event.pull_request.base.sha }}" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event_name }}" = "push" ]; then
echo "head_ref=${{ github.event.push.after }}" >> "$GITHUB_OUTPUT"
echo "base_ref=${{ github.event.push.before }}" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event_name }}" = "merge_group" ]; then
echo "head_ref=${{ github.event.merge_group.head_sha }}" >> "$GITHUB_OUTPUT"
echo "base_ref=${{ github.event.merge_group.base_sha }}" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "head_ref=${{ github.event.ref }}" >> "$GITHUB_OUTPUT"
echo "base_ref=$(git log --max-parents=0 --first-parent --format=%H)" >> "$GITHUB_OUTPUT"
fi
- name: Filter Files
id: filter-files
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
with:
ref: ${{ steps.refs.outputs.head_ref }}
base: ${{ steps.refs.outputs.base_ref }}
filters: |
check-build:
- '**.go'
- 'go.mod'
- '.github/workflows/build.yml'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
check-client:
- '**.go'
- 'go.mod'
- '.github/workflows/client-tests.yml'
check-unit-tests:
- '**.go'
- 'go.mod'
- '.github/workflows/build.yml'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
check-migrate:
- '**.go'
- 'go.mod'
- 'snap/**'
- '.github/workflows/migrate.yml'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
check-upgrade:
- '**.go'
- 'go.mod'
- 'snap/**'
- '.github/workflows/upgrade.yml'
- '.github/setup-lxd/**'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
check-snap:
- '**.go'
- 'go.mod'
- 'snap/**'
- '.github/workflows/snap.yml'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
check-terraform:
- '**.go'
- 'go.mod'
- '.github/workflows/terraform-smoke.yml'
check-generate:
- '**.go'
- 'go.mod'
- '.github/workflows/gen.yml'
check-docs:
# Paths that feed the autogenerated reference docs.
- 'cmd/**'
- 'controller/**'
- 'environs/config/**'
- 'internal/configschema/**'
- 'internal/worker/uniter/runner/jujuc/**'
- 'scripts/md-gen/**'
- 'docs/**'
- '.github/workflows/docs.yml'
- 'Makefile'
- 'go.mod'
check-ddl:
- 'go.mod'
- 'domain/schema/**'
- 'core/database/**'
- 'internal/database/**'
- 'generate/ddlgen/**'
- '.github/workflows/ddl.yml'
check-smoke:
- '**.go'
- 'go.mod'
- '.github/workflows/smoke.yml'
build:
needs: [changed-files]
name: Build
if: github.event.pull_request.draft == false && needs.changed-files.outputs.check-build == 'true'
uses: ./.github/workflows/build.yml
unit-tests:
needs: [changed-files]
name: Unit Tests
if: github.event.pull_request.draft == false && needs.changed-files.outputs.check-unit-tests == 'true'
uses: ./.github/workflows/unit-tests.yml
with:
base: ${{ needs.changed-files.outputs.base }}
snap:
needs: [changed-files]
name: Snap
if: github.event.pull_request.draft == false && needs.changed-files.outputs.check-snap == 'true' && github.event_name != 'merge_group'
uses: ./.github/workflows/snap.yml
generate:
needs: [changed-files]
name: Generate
if: github.event.pull_request.draft == false && needs.changed-files.outputs.check-generate == 'true' && github.event_name != 'merge_group'
uses: ./.github/workflows/gen.yml
docs:
needs: [changed-files]
name: Documentation
if: github.event.pull_request.draft == false && needs.changed-files.outputs.check-docs == 'true' && github.event_name != 'merge_group'
uses: ./.github/workflows/docs.yml
client:
needs: [changed-files]
name: Client Tests
if: github.event.pull_request.draft == false && needs.changed-files.outputs.check-client == 'true'
uses: ./.github/workflows/client-tests.yml
terraform:
needs: [changed-files]
name: Terraform Smoke
# TODO - always skip terraform tests until they are made reliable on 3.x branches.
if: false && github.event.pull_request.draft == false && github.base_ref != 'main' && needs.changed-files.outputs.check-terraform == 'true' && github.event_name != 'merge_group'
uses: ./.github/workflows/terraform-smoke.yml
migrate:
needs: [changed-files]
name: Migrate
if: github.event.pull_request.draft == false && needs.changed-files.outputs.check-migrate == 'true' && github.event_name != 'merge_group'
uses: ./.github/workflows/migrate.yml
upgrade:
needs: [changed-files]
name: Upgrade
if: github.event.pull_request.draft == false && github.base_ref != 'main' && needs.changed-files.outputs.check-upgrade == 'true' && github.event_name != 'merge_group'
uses: ./.github/workflows/upgrade.yml
ddl:
needs: [changed-files]
name: DDL Changes
if: github.event.pull_request.draft == false && needs.changed-files.outputs.check-ddl == 'true'
uses: ./.github/workflows/ddl.yml
smoke:
needs: [changed-files]
name: Smoke
if: github.event.pull_request.draft == false && needs.changed-files.outputs.check-smoke == 'true'
uses: ./.github/workflows/smoke.yml
result-check:
needs:
- build
- snap
- generate
- client
- migrate
- ddl
- terraform
- upgrade
- smoke
runs-on: ubuntu-latest
name: Check Tests Passed
if: always() && !cancelled()
steps:
- name: Check Results
shell: bash
run: |
# TODO - add terraform once ready.
# upgrades are currently broken because of missing sync-agent-binary
# step. Until then, we skip checking its result.
if ${{ needs.build.result == 'success' || needs.build.result == 'skipped' }} \
&& ${{ needs.snap.result == 'success' || needs.snap.result == 'skipped' }} \
&& ${{ needs.generate.result == 'success' || needs.generate.result == 'skipped' }} \
&& ${{ needs.client.result == 'success' || needs.client.result == 'skipped' }} \
&& ${{ needs.migrate.result == 'success' || needs.migrate.result == 'skipped' }} \
&& ${{ needs.ddl.result == 'success' || needs.ddl.result == 'skipped' }} \
&& ${{ needs.terraform.result != 'fix me' || needs.terraform.result == 'skipped' }} \
&& ${{ needs.upgrade.result == 'success' || needs.upgrade.result == 'skipped' }} \
&& ${{ needs.smoke.result == 'success' || needs.smoke.result == 'skipped' }}; then
exit 0
fi
exit 1