Skip to content

Commit

Permalink
change the get-userenvs action to return different sets of userenvs d…
Browse files Browse the repository at this point in the history
…epending on the (optionally) provided filter

- this allows for certain projects to "control" how broad (or narrow)
  their CI testing coverage is

- plumb the new userenv-filter capability into the core-crucible-ci
  workflow

- test the new userenv-filter capability through the
  test-core-crucible-ci workflow

- the new userenv-filter functionality is really only useful to core
  crucible projects because projects of other types (ie. benchmarks
  and tools) need to be tested against all userenvs to ensure
  compatibility
  • Loading branch information
k-rister committed Aug 4, 2024
1 parent ff44754 commit 12c71d6
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/actions/get-userenvs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ inputs:
rickshaw-directory:
description: "Where is the rickshaw repository to query for userenvs"
required: true
userenv-filter:
description: "A filter to determine which userenvs should be included"
required: false
default: "all"
outputs:
userenvs:
description: "The list of userenvs that were found"
Expand All @@ -13,8 +17,8 @@ runs:
steps:
- name: "Validate rickshaw-directory"
shell: bash
run: ${{ github.action_path }}/validate-inputs.sh ${{ inputs.rickshaw-directory }}
run: ${{ github.action_path }}/validate-inputs.sh ${{ inputs.rickshaw-directory }} ${{ inputs.userenv-filter }}
- name: "Generate userenvs list"
id: generate-userenvs-list
shell: bash
run: ${{ github.action_path }}/generate-userenv-list.sh ${{ inputs.rickshaw-directory }}
run: ${{ github.action_path }}/generate-userenv-list.sh ${{ inputs.rickshaw-directory }} ${{ inputs.userenv-filter }}
22 changes: 18 additions & 4 deletions .github/actions/get-userenvs/generate-userenv-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=bash

rickshaw_directory=${1}
userenv_filter=${2}

excludes="stream8-flexran rhel-ai"

if pushd ${rickshaw_directory}; then
Expand All @@ -12,10 +14,22 @@ if pushd ${rickshaw_directory}; then
new=( "${userenvs[@]/$ex}" )
userenvs=$new
done
userenvs_json="[\"default\","
for userenv in ${userenvs}; do
userenvs_json+="\"${userenv}\","
done
userenvs_json="["

case "${userenv_filter}" in
"all"|"minimal")
userenvs_json+="\"default\","
;;
esac

case "${userenv_filter}" in
"all"|"unique")
for userenv in ${userenvs}; do
userenvs_json+="\"${userenv}\","
done
;;
esac

userenvs_json=$(echo "${userenvs_json}" | sed -e "s/,$//")
userenvs_json+="]"
echo "userenvs_json=${userenvs_json}"
Expand Down
14 changes: 13 additions & 1 deletion .github/actions/get-userenvs/validate-inputs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,27 @@
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=bash

rickshaw_directory=${1}
userenv_filter=${2}

if ! pushd ${rickshaw_directory}; then
exit 1
fi

if [ -f rickshaw-run -a -d userenvs ]; then
ls -l userenvs/*.json
exit 0
else
ls -l
exit 1
fi

case "${userenv_filter}" in
"all"|"minimal"|"unique")
echo "valid userenv-filter: ${userenv_filter}"
;;
*)
echo "invalid userenv-filter: ${userenv_filter}"
exit 1
;;
esac

exit 0
5 changes: 5 additions & 0 deletions .github/workflows/core-crucible-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ on:
github_workspace:
required: true
type: string
userenv_filter:
required: false
type: string
default: "all"
secrets:
registry_auth:
required: false
Expand Down Expand Up @@ -127,6 +131,7 @@ jobs:
uses: ./crucible-ci/.github/actions/get-userenvs
with:
rickshaw-directory: "./rickshaw"
userenv-filter: ${{ inputs.userenv_filter }}
- name: run get-scenarios-github
id: get-scenarios-github
uses: ./crucible-ci/.github/actions/get-scenarios
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test-core-crucible-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ jobs:
fail-fast: false
matrix:
repos:
- subproject: "CommonDataModel"
subproject_dir: "CommonDataModel"
branch: "master"
userenv_filter: "minimal"
- subproject: "rickshaw"
subproject_dir: "rickshaw"
branch: "master"
userenv_filter: "all"
- subproject: "crucible"
subproject_dir: "crucible"
branch: "master"
userenv_filter: "unique"
uses: ./.github/workflows/core-crucible-ci.yaml
with:
ci_target: "${{ matrix.repos.subproject }}"
Expand All @@ -33,6 +39,7 @@ jobs:
crucible_ci_test: "yes"
crucible_ci_test_branch: "${{ github.ref }}"
github_workspace: "$GITHUB_WORKSPACE"
userenv_filter: ${{ matrix.repos.userenv_filter }}
secrets:
ci_registry_auth: ${{ secrets.CRUCIBLE_CI_ENGINES_REGISTRY_AUTH }}
quay_oauth_token: ${{ secrets.CRUCIBLE_QUAYIO_OAUTH_TOKEN }}
Expand Down

0 comments on commit 12c71d6

Please sign in to comment.