|
| 1 | +name: RPM Build and Test |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + pr-repos: |
| 7 | + description: 'Any PR-repos that you want included in this build' |
| 8 | + required: false |
| 9 | + commit-message: |
| 10 | + description: 'Commit message to use rather than the one from git' |
| 11 | + required: false |
| 12 | + rpm-test-version: |
| 13 | + description: 'RPM version to test' |
| 14 | + required: false |
| 15 | + pull_request: |
| 16 | + push: |
| 17 | + branches: |
| 18 | + - master |
| 19 | + |
| 20 | +concurrency: |
| 21 | + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 22 | + cancel-in-progress: true |
| 23 | + |
| 24 | +defaults: |
| 25 | + run: |
| 26 | + shell: bash --noprofile --norc -ueo pipefail {0} |
| 27 | + |
| 28 | +permissions: {} |
| 29 | + |
| 30 | +jobs: |
| 31 | + Variables: |
| 32 | + # What a dumb jobs this is |
| 33 | + # Needed because of https://github.com/orgs/community/discussions/26671 |
| 34 | + # Ideally want to be able to use: |
| 35 | + # with: |
| 36 | + # NAME: ${{ env.NAME }} |
| 37 | + # in the Call-RPM-Build job but the above issue prevents it |
| 38 | + name: Compute outputs |
| 39 | + runs-on: [self-hosted, light] |
| 40 | + env: |
| 41 | + # see https://github.com/organizations/daos-stack/settings/variables/actions for |
| 42 | + # the organizational defaults values for these variables |
| 43 | + # TODO: we really need to define a list of supported versions (ideally it's no more than 2) |
| 44 | + # build is done on the lowest version and test on the highest with a "sanity test" |
| 45 | + # stage done on all versions in the list ecept the highest |
| 46 | + EL8_BUILD_VERSION: ${{ vars.EL8_BUILD_VERSION_MASTER }} |
| 47 | + EL8_VERSION: ${{ vars.EL8_VERSION_MASTER }} |
| 48 | + EL9_BUILD_VERSION: ${{ vars.EL9_BUILD_VERSION_MASTER }} |
| 49 | + EL9_VERSION: ${{ vars.EL9_VERSION_MASTER }} |
| 50 | + LEAP15_VERSION: ${{ vars.LEAP15_VERSION_MASTER }} |
| 51 | + # Which distros to build for |
| 52 | + DISTROS: ${{ vars.DISTROS_MASTER }} |
| 53 | + TEST_TAG: ${{ vars.TEST_TAG }} |
| 54 | + PACKAGING_DIR: ${{ vars.PACKAGING_DIR }} |
| 55 | + outputs: |
| 56 | + NAME: ${{ steps.NAME.outputs.text }} |
| 57 | + DISTROS: ${{ env.DISTROS }} |
| 58 | + EL8_BUILD_VERSION: ${{ env.EL8_BUILD_VERSION }} |
| 59 | + EL9_BUILD_VERSION: ${{ env.EL9_BUILD_VERSION }} |
| 60 | + LEAP15_VERSION: ${{ env.LEAP15_VERSION }} |
| 61 | + PACKAGING_DIR: ${{ env.PACKAGING_DIR }} |
| 62 | + TEST_TAG: ${{ env.TEST_TAG }} |
| 63 | + steps: |
| 64 | + - name: NAME |
| 65 | + id: NAME |
| 66 | + run: | |
| 67 | + repo="${{ github.repository }}" |
| 68 | + echo "text=${repo#*/}" >> $GITHUB_OUTPUT |
| 69 | +
|
| 70 | + Call-RPM-Build: |
| 71 | + name: Build RPM |
| 72 | + needs: Variables |
| 73 | + if: inputs.rpm-test-version == '' |
| 74 | + permissions: |
| 75 | + statuses: write |
| 76 | + uses: daos-stack/actions-lib/.github/workflows/rpm-build.yml@v1 |
| 77 | + secrets: inherit |
| 78 | + with: |
| 79 | + NAME: ${{ needs.Variables.outputs.NAME }} |
| 80 | + DISTROS: ${{ needs.Variables.outputs.DISTROS }} |
| 81 | + EL8_BUILD_VERSION: ${{ needs.Variables.outputs.EL8_BUILD_VERSION }} |
| 82 | + EL9_BUILD_VERSION: ${{ needs.Variables.outputs.EL9_BUILD_VERSION }} |
| 83 | + LEAP15_VERSION: ${{ needs.Variables.outputs.LEAP15_VERSION }} |
| 84 | + PACKAGING_DIR: ${{ needs.Variables.outputs.PACKAGING_DIR}} |
| 85 | + # RUN_GHA: true |
| 86 | + |
| 87 | + Call-RPM-Test: |
| 88 | + # TODO: investigate how cancelling this can cancel the downstream job |
| 89 | + name: Test RPMs with DAOS |
| 90 | + needs: [Variables, Call-RPM-Build] |
| 91 | + uses: daos-stack/actions-lib/.github/workflows/rpm-test.yml@v1 |
| 92 | + # it would be better if we could do this in rpm-test.yml but we can't because it causes: |
| 93 | + # The nested job 'Test-with-DAOS' is requesting 'issues: write', but is only allowed |
| 94 | + # 'issues: none'. |
| 95 | + permissions: |
| 96 | + issues: write |
| 97 | + secrets: inherit |
| 98 | + with: |
| 99 | + NAME: ${{ needs.Variables.outputs.NAME }} |
| 100 | + DISTROS: ${{ needs.Variables.outputs.DISTROS }} |
| 101 | + TEST_TAG: ${{ needs.Variables.outputs.TEST_TAG }} |
| 102 | + RUN_GHA: ${{ needs.Call-RPM-Build.outputs.run-gha == 'true' }} |
0 commit comments