maint/CICD ~ (GnuTests) refactor GnuTests GHA config

- combine gnu/gnulib into single repository checkout
- code consolidation
- DRY changes
- variable consolidation and renaming
- job/step naming normalization
This commit is contained in:
Roy Ivy III 2022-02-11 00:52:28 -06:00
parent b7676c07e9
commit 29679ba337

View file

@ -17,11 +17,10 @@ jobs:
outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo ::set-output name=${var}::${!var}; done; } outputs() { step_id="vars"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo ::set-output name=${var}::${!var}; done; }
# * config # * config
path_GNU="gnu" path_GNU="gnu"
path_GNULIB="gnulib" path_GNU_tests="${path_GNU}/tests"
path_GNU_tests="gnu/tests"
path_UUTILS="uutils" path_UUTILS="uutils"
path_reference="reference" path_reference="reference"
outputs path_GNU path_GNU_tests path_GNULIB path_reference path_UUTILS outputs path_GNU path_GNU_tests path_reference path_UUTILS
# #
repo_default_branch="${{ github.event.repository.default_branch }}" repo_default_branch="${{ github.event.repository.default_branch }}"
repo_GNU_ref="v9.0" repo_GNU_ref="v9.0"
@ -35,23 +34,17 @@ jobs:
TEST_FILESET_SUFFIX='.txt' TEST_FILESET_SUFFIX='.txt'
TEST_SUMMARY_FILE='gnu-result.json' TEST_SUMMARY_FILE='gnu-result.json'
outputs SUITE_LOG_FILE TEST_FILESET_PREFIX TEST_FILESET_SUFFIX TEST_LOGS_GLOB TEST_SUMMARY_FILE outputs SUITE_LOG_FILE TEST_FILESET_PREFIX TEST_FILESET_SUFFIX TEST_LOGS_GLOB TEST_SUMMARY_FILE
- name: Checkout code uutil - name: Checkout code (uutil)
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
path: '${{ steps.vars.outputs.path_UUTILS }}' path: '${{ steps.vars.outputs.path_UUTILS }}'
- name: Checkout GNU coreutils - name: Checkout code (GNU coreutils)
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
repository: 'coreutils/coreutils' repository: 'coreutils/coreutils'
path: '${{ steps.vars.outputs.path_GNU }}' path: '${{ steps.vars.outputs.path_GNU }}'
ref: ${{ steps.vars.outputs.repo_GNU_ref }} ref: ${{ steps.vars.outputs.repo_GNU_ref }}
- name: Checkout GNU coreutils library (gnulib) submodules: recursive
uses: actions/checkout@v2
with:
repository: 'coreutils/gnulib'
path: '${{ steps.vars.outputs.path_GNULIB }}'
ref: ${{ steps.vars.outputs.repo_GNULIB_ref }}
fetch-depth: 0 # full depth checkout (o/w gnu gets upset if gnulib is a shallow checkout)
- name: Retrieve reference artifacts - name: Retrieve reference artifacts
uses: dawidd6/action-download-artifact@v2 uses: dawidd6/action-download-artifact@v2
# ref: <https://github.com/dawidd6/action-download-artifact> # ref: <https://github.com/dawidd6/action-download-artifact>
@ -85,7 +78,6 @@ jobs:
shell: bash shell: bash
run: | run: |
path_GNU='${{ steps.vars.outputs.path_GNU }}' path_GNU='${{ steps.vars.outputs.path_GNU }}'
path_GNULIB='${{ steps.vars.outputs.path_GNULIB }}'
path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}' path_UUTILS='${{ steps.vars.outputs.path_UUTILS }}'
bash "${path_UUTILS}/util/run-gnu-test.sh" bash "${path_UUTILS}/util/run-gnu-test.sh"
- name: Extract/summarize testing info - name: Extract/summarize testing info