diff --git a/.bumpversion.cfg b/.bumpversion.cfg index ff0a154..377c918 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.10.0 +current_version = 1.11.0 commit = True message = Bumps version to {new_version} tag = False diff --git a/.github/workflows/test-terrafirm-integration.yml b/.github/workflows/test-terrafirm-integration.yml new file mode 100644 index 0000000..9eec999 --- /dev/null +++ b/.github/workflows/test-terrafirm-integration.yml @@ -0,0 +1,67 @@ +name: Run terrafirm integration tests for salt formulas + +on: + workflow_call: + inputs: + source-build: + description: Source build to test (e.g., al2023, centos9stream, rhel8, rhel9, rl9, ol9, win16, win19, win22) + required: true + type: string + + formula-archive-url: + description: Optional URL for formula zip archive; if omitted, dynamically generated from event + required: false + type: string + default: "" + terrafirm-git-repo-name: + description: Terrafirm repository in owner/repo format + required: false + type: string + default: plus3it/terrafirm + terrafirm-git-ref: + description: Terrafirm Git ref (branch/tag/commit) + required: false + type: string + default: master + watchmaker-common-args: + description: Watchmaker arguments passed to terrafirm, shared by linux and windows platforms + required: false + type: string + default: "-n -e dev" + watchmaker-git-url: + description: Watchmaker git clone URL + required: false + type: string + default: https://github.com/plus3it/watchmaker.git + watchmaker-git-ref: + description: Watchmaker Git ref used for source installs + required: false + type: string + default: main + +permissions: + contents: read + +jobs: + test-source: + runs-on: ${{ fromJSON(format('["codebuild-p3-terrafirm-{0}-{1}", "image-size:small"]', github.run_id, github.run_attempt)) }} + env: + AWS_DEFAULT_REGION: us-east-1 + TF_VAR_aws_region: us-east-1 + TF_VAR_codebuild_id: ${{ github.run_id }}-${{ github.run_attempt }} + TF_VAR_common_args: ${{ inputs.watchmaker-common-args }} + TF_VAR_user_formulas: >- + {"${{ github.event.repository.name }}":"${{ inputs.formula-archive-url || format('https://github.com/{0}/archive/refs/heads/{1}.zip', github.event.pull_request.head.repo.full_name || github.repository, github.event.pull_request.head.ref || github.ref_name) }}"} + TF_VAR_git_ref: ${{ inputs.watchmaker-git-ref || 'main' }} + TF_VAR_git_repo: ${{ inputs.watchmaker-git-url || 'https://github.com/plus3it/watchmaker.git' }} + TF_VAR_source_builds: '["${{ inputs.source-build }}"]' + TF_VAR_source_source: git + TF_VAR_standalone_builds: '[]' + steps: + - name: Terrafirm integration tests + id: terrafirm + uses: plus3it/terrafirm/.github/actions/test@cfbd4fbc74ae901b598184b538a7bdd0e9ac74eb + with: + destroy-after-test: true + terrafirm-repository: ${{ inputs.terrafirm-git-repo-name }} + terrafirm-ref: ${{ inputs.terrafirm-git-ref }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 23cb96a..965d90e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +### [1.11.0](https://github.com/plus3it/actions-workflows/releases/tag/1.11.0) + +**Released**: 2026.07.15 + +* Provides a reusable workflow for running terrafirm integration tests with salt formulas +* Dependency Updates + * softprops/action-gh-release 3.0.1 + * actions/checkout 7.0.0 + * tardigrade-ci 0.29.6 + ### [1.10.0](https://github.com/plus3it/actions-workflows/releases/tag/1.10.0) **Released**: 2026.04.27 diff --git a/README.md b/README.md index 571c730..d104427 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ workflows are located in the directory [.github/workflows](.github/workflows). * [lint](.github/workflows/lint.yml) * [test](.github/workflows/test.yml) +* [test-terrafirm-integration](.github/workflows/test-terrafirm-integration.yml) * [release](.github/workflows/release.yml) The release logic is also available as a composite action. Only difference is that @@ -29,7 +30,7 @@ Inputs: An example of calling the reusable `lint` workflow: -``` +```yaml name: Run lint and static analyis checks on: pull_request: @@ -55,7 +56,7 @@ Inputs: An example of calling the reusable `test` workflow: -``` +```yaml name: Run test jobs on: pull_request: @@ -70,6 +71,71 @@ jobs: uses: plus3it/actions-workflows/.github/workflows/test.yml@v1 ``` +### `test-terrafirm-integration` + +Reusable workflow for running terrafirm integration tests in salt formula repositories. +The caller workflow is responsible for defining trigger conditions (e.g., PR review comment, +workflow dispatch, schedule) and specifying the test matrix. This workflow handles test +execution with CodeBuild runners for a single source build. + +Inputs: + +* `source-build`: **Required.** Source build to test (e.g., al2023, centos9stream, rhel8, rhel9, ol9). +* `watchmaker-git-url`: Watchmaker Git clone URL. Defaults to `https://github.com/plus3it/watchmaker.git`. +* `watchmaker-git-ref`: Watchmaker Git ref (branch/tag). Defaults to `main`. +* `watchmaker-common-args`: Watchmaker arguments passed to terrafirm, shared by linux and windows platforms. Defaults to `"-n -e dev"`. +* `formula-archive-url`: Optional URL for formula zip archive. If omitted, dynamically generated from event. + +An example of calling the reusable `test-terrafirm-integration` workflow: + +```yaml +name: Run terrafirm integration tests + +on: + workflow_dispatch: + inputs: + watchmaker-git-url: + description: Watchmaker git clone URL + required: false + default: https://github.com/plus3it/watchmaker.git + type: string + watchmaker-git-ref: + description: Watchmaker git ref + required: false + default: main + type: string + formula-archive-url: + description: Optional URL to the salt formula zip archive + required: false + default: "" + type: string + + pull_request_review: + types: [submitted] + +permissions: + contents: read + +jobs: + integration: + if: contains(github.event.review.body, '/build') || github.event_name == 'workflow_dispatch' + strategy: + fail-fast: false + matrix: + source-build: + - al2023 + - centos9stream + - rhel8 + - rhel9 + - ol9 + uses: plus3it/actions-workflows/.github/workflows/test-terrafirm-integration.yml@ + with: + source-build: ${{ matrix.source-build }} + watchmaker-git-url: ${{ github.event.inputs.watchmaker-git-url }} + watchmaker-git-ref: ${{ github.event.inputs.watchmaker-git-ref }} + formula-archive-url: ${{ github.event.inputs.formula-archive-url }} +``` + ### `release` Inputs: @@ -82,7 +148,7 @@ Secrets: An example of calling the reusable `release` workflow: -``` +```yaml name: Create GitHub Release on: @@ -112,7 +178,7 @@ Inputs: * `draft`: Optional. Creates the GitHub Release as a draft. Defaults to `false`. * `release-token`: Required. Token with permissions to create GitHub Releases. -``` +```yaml name: Create GitHub Release on: