Skip to content

Commit

Permalink
Add build_whl job in GitHub actions to build DE modules whl
Browse files Browse the repository at this point in the history
  • Loading branch information
vitodb committed Dec 28, 2023
1 parent 148e2fe commit 12dcfa3
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/actions/python-command-in-el9-container/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0

name: "Python Action"
description: "Run python3 action in preconfigured EL9 container image"
inputs:
python-command:
description: "What to run"
required: true
default: "-m pytest"
logfile:
description: "Where to log output"
required: true
default: "pytest.log"
runs:
using: "docker"
image: "../../../package/ci/EL9/Dockerfile"
args:
- ${{ inputs.python-command }}
- ${{ inputs.logfile }}
39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,42 @@ jobs:
run: |
cd doc
make rst html latexpdf
build_whl:
if: ${{ github.ref != 'refs/heads/1.7' }}
name: Build DE Modules whl
runs-on: ubuntu-latest
needs: pytest
steps:
- name: make date tag
id: mkdatetag
run: echo "::set-output name=dtag::$(date +%Y%m%d_%H%M%S)"

- name: make ref tag case 1
id: mkreftag1
if: ${{ github.event.inputs.ref != '' }}
run: echo "::set-output name=reftag::${{github.event.inputs.ref}}"

- name: make ref tag case 2
id: mkreftag2
if: ${{ github.event.inputs.ref == '' }}
run: echo "::set-output name=reftag::${GITHUB_BASE_REF:+PR}"$(awk -F"/" '{print $3}' <<< ${GITHUB_REF})

- name: checkout code tree
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{github.event.inputs.ref}}

- name: Run the build in a container (EL9/HEPCloud-CI)
uses: ./.github/actions/python-command-in-el9-container
with:
python-command: "setup.py bdist_wheel"
logfile: "build_whl.log"

- name: Archive whl
uses: actions/upload-artifact@v3
with:
name: whl-DE-EL9-${{steps.mkreftag1.outputs.reftag}}${{steps.mkreftag2.outputs.reftag}}-${{steps.mkdatetag.outputs.dtag}}
path: dist/*.whl
if-no-files-found: error

0 comments on commit 12dcfa3

Please sign in to comment.