Skip to content

Commit

Permalink
Respect strategy selection. See #276
Browse files Browse the repository at this point in the history
  • Loading branch information
kwk committed Feb 22, 2024
1 parent d00eb68 commit 452fdb3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/testing-farm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ on:
type: string
strategy:
description: 'Build strategy'
default: 'big-merge'
default: 'all'
required: true
type: choice
options:
- all
- big-merge
- standalone
- bootstrap
Expand Down Expand Up @@ -92,31 +93,35 @@ jobs:
artifact_name=testing-farm-${{ matrix.os-version }}-${{env.yyyymmdd}}
echo "artifact_name=$artifact_name" >> $GITHUB_ENV
touch /tmp/$artifact_name
artifact_exists=0
skip=0
./scripts/workflow-artifact-exists.py \
--token ${{ secrets.GITHUB_TOKEN }} \
--project ${{ github.repository }} \
--workflow-name ${{ github.workflow }} \
--artifact-name $artifact_name \
&& artifact_exists=1
&& skip=1
if [[ "${{ github.event_name }}" == "workflow_dispatch" && ${{ github.event.inputs.force-test }} ]]; then
artifact_exists=0
skip=0
fi
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.strategy}}" != "all" ]]; then
echo "${{ matrix.strategy }}" | grep "${{ github.event.inputs.strategy}}" > /dev/null || skip=1
fi
echo "artifact_exists=$artifact_exists" >> $GITHUB_ENV
echo "skip=$skip" >> $GITHUB_ENV
- name: Create artifact for this testing-farm run if not already done
if: ${{ env.artifact_exists != 1 }}
if: ${{ env.skip == 0 }}
uses: actions/upload-artifact@v4
with:
name: ${{env.artifact_name}}
path: /tmp/${{env.artifact_name}}
if-no-files-found: warn

- name: "Run testing-farm"
if: ${{ env.artifact_exists != 1 }}
if: ${{ env.skip == 0 }}
shell: bash -e {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 452fdb3

Please sign in to comment.