Skip to content

Commit

Permalink
PI-1414 update pipeline to allow auto passing of projects (#2315)
Browse files Browse the repository at this point in the history
* PI-1414 update pipeline to allow auto passing of projects

* PI-1414 update pipeline to allow auto passing of projects

* PI-1414 try using different string marks

* PI-1414 update to underscore

* PI-1414 use jq to merge and intersect

* Remove Rogue done
  • Loading branch information
anthony-britton-moj authored Sep 28, 2023
1 parent ce89267 commit 73d0be7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ on:
# ^ add new projects here
# GitHub Actions doesn't support dynamic choices, we must add each project here to enable manual deployments
# See https://github.com/community/community/discussions/11795
env:
auto_pass_projects: '["manage-offences-and-delius"]'

jobs:
test:
Expand Down Expand Up @@ -148,6 +150,8 @@ jobs:
skipped_projects=$(echo "$all_projects" | jq -r '.[]' | while read -r project; do if [ ! -d "tests/$project" ]; then echo $project; fi; done | jq --raw-input . | jq --slurp --compact-output .)
failed_projects=$(jq -r '.suites[].specs[] | select(.ok == false).file' results.json | xargs -n1 dirname | sort -u | jq --raw-input . | jq --slurp --compact-output .)
passed_projects=$(jq --compact-output --null-input --argjson all "$all_projects" --argjson failed "$failed_projects" --argjson skipped "$skipped_projects" '{all: $all, failed: $failed, skipped: $skipped} | .all - .failed - .skipped')
merged=$(echo "$auto_pass_projects $passed_projects" | jq -s 'add')
passed_projects=$(echo "$merged $projects" | jq -sc '.[0] - (.[0] - .[1])')
fi
echo "skipped-projects=${skipped_projects:-'[]'}" | tee -a "$GITHUB_OUTPUT"
echo "failed-projects=${failed_projects:-'[]'}" | tee -a "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 73d0be7

Please sign in to comment.