From ff447547e54130b87319714e398cfc3a78ea2229 Mon Sep 17 00:00:00 2001 From: Karl Rister Date: Sun, 4 Aug 2024 12:19:45 -0500 Subject: [PATCH 1/2] remove run-core-crucible-ci workflow from crucible-ci - this is really just a duplicate of test-core-crucible-ci and adds unnecessary jobs --- .github/workflows/faux-crucible-ci.yaml | 3 --- .github/workflows/run-core-crucible-ci.yaml | 25 --------------------- 2 files changed, 28 deletions(-) delete mode 100644 .github/workflows/run-core-crucible-ci.yaml diff --git a/.github/workflows/faux-crucible-ci.yaml b/.github/workflows/faux-crucible-ci.yaml index 267d183..b0a8ba5 100644 --- a/.github/workflows/faux-crucible-ci.yaml +++ b/.github/workflows/faux-crucible-ci.yaml @@ -27,6 +27,3 @@ jobs: runs-on: [ self-hosted, workflow-overhead ] steps: - run: 'echo "No build required" ' - - call-core-crucible-ci: - uses: ./.github/workflows/faux-core-crucible-ci.yaml diff --git a/.github/workflows/run-core-crucible-ci.yaml b/.github/workflows/run-core-crucible-ci.yaml deleted file mode 100644 index 9ace423..0000000 --- a/.github/workflows/run-core-crucible-ci.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: run-core-crucible-ci - -on: - pull_request: - branches: [ main ] - paths-ignore: - - LICENSE - - '**.md' - - .github/workflows/faux-crucible-ci.yaml - - .github/workflows/faux-benchmark-crucible-ci.yaml - - .github/workflows/faux-core-crucible-ci.yaml - - .github/workflows/faux-tool-crucible-ci.yaml - - 'docs/**' - workflow_dispatch: - -jobs: - call-core-crucible-ci: - uses: ./.github/workflows/core-crucible-ci.yaml - with: - ci_target: "crucible-ci" - ci_target_branch: "${{ github.ref }}" - github_workspace: "$GITHUB_WORKSPACE" - secrets: - ci_registry_auth: ${{ secrets.CRUCIBLE_CI_ENGINES_REGISTRY_AUTH }} - quay_oauth_token: ${{ secrets.CRUCIBLE_QUAYIO_OAUTH_TOKEN }} From 12c71d6bb156311fa966bc1f6f35d43409ce4bbc Mon Sep 17 00:00:00 2001 From: Karl Rister Date: Sun, 4 Aug 2024 12:24:43 -0500 Subject: [PATCH 2/2] change the get-userenvs action to return different sets of userenvs depending 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 --- .github/actions/get-userenvs/action.yml | 8 +++++-- .../get-userenvs/generate-userenv-list.sh | 22 +++++++++++++++---- .../actions/get-userenvs/validate-inputs.sh | 14 +++++++++++- .github/workflows/core-crucible-ci.yaml | 5 +++++ .github/workflows/test-core-crucible-ci.yaml | 7 ++++++ 5 files changed, 49 insertions(+), 7 deletions(-) diff --git a/.github/actions/get-userenvs/action.yml b/.github/actions/get-userenvs/action.yml index f6652bd..7a49b4c 100644 --- a/.github/actions/get-userenvs/action.yml +++ b/.github/actions/get-userenvs/action.yml @@ -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" @@ -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 }} diff --git a/.github/actions/get-userenvs/generate-userenv-list.sh b/.github/actions/get-userenvs/generate-userenv-list.sh index b0e9ad2..f614549 100755 --- a/.github/actions/get-userenvs/generate-userenv-list.sh +++ b/.github/actions/get-userenvs/generate-userenv-list.sh @@ -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 @@ -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}" diff --git a/.github/actions/get-userenvs/validate-inputs.sh b/.github/actions/get-userenvs/validate-inputs.sh index d09d9f0..003f45d 100755 --- a/.github/actions/get-userenvs/validate-inputs.sh +++ b/.github/actions/get-userenvs/validate-inputs.sh @@ -3,6 +3,7 @@ # vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=bash rickshaw_directory=${1} +userenv_filter=${2} if ! pushd ${rickshaw_directory}; then exit 1 @@ -10,8 +11,19 @@ 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 diff --git a/.github/workflows/core-crucible-ci.yaml b/.github/workflows/core-crucible-ci.yaml index 5438d62..f1e1f96 100644 --- a/.github/workflows/core-crucible-ci.yaml +++ b/.github/workflows/core-crucible-ci.yaml @@ -23,6 +23,10 @@ on: github_workspace: required: true type: string + userenv_filter: + required: false + type: string + default: "all" secrets: registry_auth: required: false @@ -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 diff --git a/.github/workflows/test-core-crucible-ci.yaml b/.github/workflows/test-core-crucible-ci.yaml index 37e4cba..9ae5666 100644 --- a/.github/workflows/test-core-crucible-ci.yaml +++ b/.github/workflows/test-core-crucible-ci.yaml @@ -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 }}" @@ -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 }}