Add GHA workflow to build and test RPMs #107
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: RPM Build and Test | |
env: | |
# TODO: Surely this is a GH variable of some sort for the name of the repo | |
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] | |
env: | |
# see https://github.com/organizations/daos-stack/settings/variables/actions for | |
# the organizational defaults values for these variables | |
# 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: ${{ vars.EL8_BUILD_VERSION_MASTER }} | |
EL8_VERSION: ${{ vars.EL8_BUILD_VERSION_MASTER }} | |
EL9_BUILD_VERSION: ${{ vars.EL9_BUILD_VERSION_MASTER }} | |
EL9_VERSION: ${{ vars.EL9_BUILD_VERSION_MASTER }} | |
LEAP15_VERSION: ${{ vars.LEAP15_VERSION_MASTER }} | |
# Which distros to build for | |
DISTROS: ${{ vars.DISTROS_MASTER }} | |
TEST_TAG: ${{ vars.TEST_TAG }} | |
PACKAGING_DIR: ${{ vars.PACKAGING_DIR }} | |
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 | |
# yamllint disable-line rule:line-length | |
uses: daos-stack/actions-lib/.github/workflows/rpm-build.yml@bmurrell/skip-rpm-build-without-run-gha | |
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@v1 | |
# it would be better if we could do this in rpm-test.yml but we can't because it causes: | |
# The nested job 'Test-with-DAOS' is requesting 'issues: write', but is only allowed | |
# 'issues: none'. | |
permissions: | |
issues: write | |
secrets: inherit | |
with: | |
NAME: ${{ needs.Variables.outputs.NAME }} | |
DISTROS: ${{ needs.Variables.outputs.DISTROS }} | |
# TODO/THINK-ABOUT: should we propagate *_VERSION here (assuming we make rpm-test.yml | |
# and daos-stack/daos…rpm-build-and-test.yml accept these as inputs) | |
# or should the daos-stack/daos pipline be responsible for setting them? | |
# ultimately if/when we choose hte latter we can get rid of all references | |
# to *_VERSION here. | |
TEST_TAG: ${{ needs.Variables.outputs.TEST_TAG }} | |
RUN_GHA: ${{ needs.Call-RPM-Build.outputs.run-gha == 'true' }} |