Skip to content

Commit

Permalink
Add dry-run-option. See #276
Browse files Browse the repository at this point in the history
  • Loading branch information
kwk committed Feb 26, 2024
1 parent 7964fe7 commit ec08c2f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/testing-farm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ on:
default: false
required: true
type: boolean
dry-run:
description: 'Do not submit request to testing-farm, just print it'
default: true
required: true
type: boolean

permissions:
# Allow to store artifacts
Expand Down Expand Up @@ -111,9 +116,13 @@ jobs:
echo "skip=$skip" >> $GITHUB_ENV
if [[ "${{ github.event_name }}" == "workflow_dispatch" && ${{ github.event.inputs.dry-run }} ]]; then
echo "dont_create_artifact=1" >> $GITHUB_ENV
fi
- name: Create artifact for this testing-farm run if not already done
if: ${{ env.skip == 0 }}
if: ${{ env.skip == 0 || "env.dont_create_artifact" != "1" }}
uses: actions/upload-artifact@v4
with:
name: ${{env.artifact_name}}
Expand Down Expand Up @@ -146,6 +155,11 @@ jobs:
>&2 echo "arch = $arch"
>&2 echo "version = $version"
dry_run_option=
if [[ "${{ github.event_name }}" == "workflow_dispatch" && ${{ github.event.inputs.dry-run }} ]]; then
dry_run_option=--dry-run
fi
testing-farm \
request \
--compose ${name^}-${version} \
Expand All @@ -154,7 +168,7 @@ jobs:
--plan /tests/snapshot-gating \
--environment COPR_PROJECT=${{ env.copr_project }} \
--context distro=${name}-${version} \
--context arch=${arch} \
--context arch=${arch} $dry_run_option \
--context snapshot=${{env.yyyymmdd}}
# Don't be fooled, we currently need the repetition of arch and alike
Expand Down

0 comments on commit ec08c2f

Please sign in to comment.