Skip to content

Commit

Permalink
CICD: improve PR job variable configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
swharden committed Apr 13, 2024
1 parent 17537fa commit dcab57b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/pr1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ jobs:
evaluate:
name: Evaluate Changes
runs-on: ubuntu-latest
outputs:
MOD_SP4: ${{ steps.set-vars.outputs.MOD_SP4 }}
MOD_SP5: ${{ steps.set-vars.outputs.MOD_SP5 }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -28,6 +31,7 @@ jobs:
sed -n '/src\/ScottPlot5/p' changed.txt > changed5.txt
find . -type f -name "changed*.txt" -empty -delete
- name: Set workflow variables
id: set-vars
run: |
echo "MOD_SP4=$( [[ -f changed4.txt ]] && echo true || echo false )" >> $GITHUB_ENV
echo "MOD_SP5=$( [[ -f changed5.txt ]] && echo true || echo false )" >> $GITHUB_ENV
Expand All @@ -37,9 +41,6 @@ jobs:
- name: ScottPlot5 Changed (${{ env.MOD_SP5 }})
if: ${{ env.MOD_SP5 == 'true' }}
run: echo sp5 changed
outputs:
MOD_SP4: ${{ steps.evaluate.outputs.MOD_SP4 }}
MOD_SP5: ${{ steps.evaluate.outputs.MOD_SP5 }}

sp4-check:
needs: evaluate
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pr2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
evaluate:
name: Evaluate Changes
runs-on: ubuntu-latest
outputs:
MOD_SP4: ${{ steps.set-vars.outputs.MOD_SP4 }}
MOD_SP5: ${{ steps.set-vars.outputs.MOD_SP5 }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -33,6 +36,7 @@ jobs:
sed -n '/src\/ScottPlot5/p' changed.txt > changed5.txt
find . -type f -name "changed*.txt" -empty -delete
- name: Set workflow variables
id: set-vars
run: |
echo "MOD_SP4=$( [[ -f changed4.txt ]] && echo true || echo false )" >> $GITHUB_ENV
echo "MOD_SP5=$( [[ -f changed5.txt ]] && echo true || echo false )" >> $GITHUB_ENV
Expand All @@ -42,9 +46,6 @@ jobs:
- name: ScottPlot5 Changed (${{ env.MOD_SP5 }})
if: ${{ env.MOD_SP5 == 'true' }}
run: echo sp5 changed
outputs:
MOD_SP4: ${{ steps.evaluate.outputs.MOD_SP4 }}
MOD_SP5: ${{ steps.evaluate.outputs.MOD_SP5 }}

sp4-full:
needs: evaluate
Expand Down

0 comments on commit dcab57b

Please sign in to comment.