From 7f95f0d5a71008f566e06f6e086a91f732b9eb87 Mon Sep 17 00:00:00 2001 From: "Brian J. Murrell" Date: Tue, 22 Nov 2022 22:27:48 -0500 Subject: [PATCH] Add GHA workflow to build and test RPMs Skip-PR-comments: true Run-GHA: true Required-githooks: true Signed-off-by: Brian J. Murrell --- .github/workflows/rpm-build-and-test.yml | 95 ++++++++++++++++++++++++ .gitignore | 3 +- .yamllint.yaml | 23 ++++++ 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/rpm-build-and-test.yml create mode 100644 .yamllint.yaml diff --git a/.github/workflows/rpm-build-and-test.yml b/.github/workflows/rpm-build-and-test.yml new file mode 100644 index 00000000..68029845 --- /dev/null +++ b/.github/workflows/rpm-build-and-test.yml @@ -0,0 +1,95 @@ +name: RPM Build and Test + +env: + # TODO: we really need to define a list of supported versions (ideally it's no more than 2) + # build is done on the lowest version and test on the highest with a "sanity test" + # stage done on all versions in the list ecept the highest + EL8_BUILD_VERSION: 8.6 + EL8_VERSION: 8.8 + EL9_BUILD_VERSION: 9.4 + EL9_VERSION: 9.4 + LEAP15_VERSION: 15.5 + # Which distros to build for + DISTROS: el8 el9 leap15 + TEST_TAG: pr + PACKAGING_DIR: . + NAME: argobots + +on: + workflow_dispatch: + inputs: + pr-repos: + description: 'Any PR-repos that you want included in this build' + required: false + commit-message: + description: 'Commit message to use rather than the one from git' + required: false + rpm-test-version: + description: 'RPM version to test' + required: false + pull_request: + push: + branches: + - master + +concurrency: + group: rpm-build-and-test-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +defaults: + run: + shell: bash --noprofile --norc -ueo pipefail {0} + +permissions: {} + +jobs: + Variables: + # What a dumb jobs this is + # Needed because of https://github.com/orgs/community/discussions/26671 + # Ideally want to be able to use: + # with: + # NAME: ${{ env.NAME }} + # in the Call-RPM-Build job but the above issue prevents it + name: Compute outputs + runs-on: [self-hosted, light] + outputs: + NAME: ${{ env.NAME }} + DISTROS: ${{ env.DISTROS }} + EL8_BUILD_VERSION: ${{ env.EL8_BUILD_VERSION }} + EL9_BUILD_VERSION: ${{ env.EL9_BUILD_VERSION }} + LEAP15_VERSION: ${{ env.LEAP15_VERSION }} + PACKAGING_DIR: ${{ env.PACKAGING_DIR }} + TEST_TAG: ${{ env.TEST_TAG }} + steps: + - name: Echo + if: false + run: echo + + Call-RPM-Build: + name: Build RPM + needs: Variables + if: inputs.rpm-test-version == '' + permissions: + statuses: write + uses: daos-stack/actions-lib/.github/workflows/rpm-build.yml@bmurrell/initial + secrets: inherit + with: + NAME: ${{ needs.Variables.outputs.NAME }} + DISTROS: ${{ needs.Variables.outputs.DISTROS }} + EL8_BUILD_VERSION: ${{ needs.Variables.outputs.EL8_BUILD_VERSION }} + EL9_BUILD_VERSION: ${{ needs.Variables.outputs.EL9_BUILD_VERSION }} + LEAP15_VERSION: ${{ needs.Variables.outputs.LEAP15_VERSION }} + PACKAGING_DIR: ${{ needs.Variables.outputs.PACKAGING_DIR}} + # RUN_GHA: true + + Call-RPM-Test: + # TODO: investigate how cancelling this can cancel the downstream job + name: Test RPMs with DAOS + needs: [Variables, Call-RPM-Build] + uses: daos-stack/actions-lib/.github/workflows/rpm-test.yml@bmurrell/initial + secrets: inherit + with: + NAME: ${{ needs.Variables.outputs.NAME }} + DISTROS: ${{ needs.Variables.outputs.DISTROS }} + TEST_TAG: ${{ needs.Variables.outputs.TEST_TAG }} + RUN_GHA: ${{ needs.Call-RPM-Build.outputs.run-gha == 'true' }} diff --git a/.gitignore b/.gitignore index 6daaa65c..9674066f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ _topdir/ *.tar.gz -*-workspace \ No newline at end of file +*-workspace +mock_result/ diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 00000000..cd8fe31a --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,23 @@ +# Yamllint configuration file, used by github actions and commit hooks. +# +# The yamllint tool will use .yamllint in preference to this file and it is in .gitignore so users +# can create one locally to overrule these settings for local commit hooks. + +extends: default + +rules: + line-length: + max: 100 + indentation: + spaces: 2 + truthy: + allowed-values: ['true', 'false', 'True', 'False'] + check-keys: false + document-start: + present: false + document-end: + present: false + +ignore: | + /_topdir/ + /.git/