mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-08-24 22:21:43 +02:00
[wheel build] test GitHub actions
This commit is contained in:
parent
1a5babd403
commit
f1e3d34ea4
38
.github/workflows/actions.yml
vendored
38
.github/workflows/actions.yml
vendored
@ -5,8 +5,32 @@ on:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
|
||||
get_commit_message:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
name: Get commit message
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
message: ${{ steps.commit_message.outputs.message }}
|
||||
steps:
|
||||
- name: Checkout the repo
|
||||
uses: actions/checkout@v2
|
||||
# Gets the correct commit message for pull request
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Get commit message
|
||||
id: commit_message
|
||||
run: |
|
||||
set -xe
|
||||
COMMIT_MSG=$(git log --no-merges -1 --oneline)
|
||||
echo "::set-output name=message::$COMMIT_MSG"
|
||||
|
||||
|
||||
trexio_ubuntu:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
@ -43,6 +67,20 @@ jobs:
|
||||
- name: check Python API
|
||||
run: make python-test
|
||||
|
||||
- name: build Python API distribution
|
||||
run: make python-sdist
|
||||
|
||||
- name: publish Python API distribution as an artifact
|
||||
needs: get_commit_message
|
||||
if: >-
|
||||
contains(needs.get_commit_message.outputs.message, '[wheel build]') ||
|
||||
github.event_name == 'release'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: pytrexio-source
|
||||
path: ./trexio-*.tar.gz
|
||||
working-directory: python/dist
|
||||
|
||||
- name: clean
|
||||
run: make clean
|
||||
|
||||
|
47
.github/workflows/build-wheels.yml
vendored
47
.github/workflows/build-wheels.yml
vendored
@ -1,12 +1,13 @@
|
||||
|
||||
# Controls when the workflow will run
|
||||
on:
|
||||
# Triggers the workflow on push events but only for the master branch
|
||||
push:
|
||||
# run this workflow after the TREXIO CI completed
|
||||
workflow_run:
|
||||
workflows: [ "TREXIO CI" ]
|
||||
branches: [ master ]
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
- completed
|
||||
|
||||
# Workflow to build and publish wheels.
|
||||
#
|
||||
# in the get_commit_message job: Include [wheel build] in your commit message to trigger the build.
|
||||
@ -15,6 +16,7 @@ name: PyPI wheels build
|
||||
jobs:
|
||||
|
||||
get_commit_message:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
name: Get commit message
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
@ -56,35 +58,24 @@ jobs:
|
||||
- name: Install build dependencies
|
||||
run: python -m pip install -U setuptools
|
||||
|
||||
- name: Run SWIG to procude the wrapper code for Python
|
||||
run: |
|
||||
swig -python -py3 -o pytrexio_wrap.c pytrexio.i
|
||||
cp pytrexio.py ../pytrexio/
|
||||
working-directory: src
|
||||
|
||||
- name: Build distribution tarball
|
||||
run: |
|
||||
python setup.py sdist
|
||||
mv ./dist/trexio-*.tar.gz .
|
||||
- name: Download the Python API distribution tarball
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: pytrexio-source
|
||||
path: python
|
||||
|
||||
- name: Build manylinux wheels
|
||||
run: |
|
||||
docker pull ghcr.io/q-posev/hdf5_1_12_on_${{ matrix.manylinux_tag }}:latest
|
||||
docker run --rm --env PLAT=manylinux${{ matrix.manylinux_tag }} --volume `pwd`:/tmp --workdir /tmp ghcr.io/q-posev/hdf5_1_12_on_${{ matrix.manylinux_tag }} /bin/bash build_manylinux_wheels.sh trexio-*.tar.gz
|
||||
working-directory: python
|
||||
|
||||
- name: Upload produced wheels as artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: pytrexio-manylinux-${{ matrix.manylinux_tag }}
|
||||
path: ./wheelhouse/*.whl
|
||||
|
||||
# only upload the source code tarball once
|
||||
- name: Upload source code tarball as an artifact (only once)
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: pytrexio-source
|
||||
path: ./trexio-*.tar.gz
|
||||
if: ${{ matrix.manylinux_tag == '2014_x86_64' }}
|
||||
working-directory: python
|
||||
|
||||
|
||||
build_macos_wheels:
|
||||
@ -126,23 +117,25 @@ jobs:
|
||||
# it is not possible to set ENV variables conditionally, so we improvise below
|
||||
run: echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> $GITHUB_ENV
|
||||
|
||||
- name: Run SWIG to procude the wrapper code for Python
|
||||
run: |
|
||||
swig -python -py3 -o pytrexio_wrap.c pytrexio.i
|
||||
cp pytrexio.py ../pytrexio/
|
||||
working-directory: src
|
||||
- name: Download the Python API distribution tarball
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: pytrexio-source
|
||||
path: python
|
||||
|
||||
- name: Build wheel for a given version of CPython
|
||||
run: |
|
||||
source tools/set_NUMPY_INCLUDEDIR.sh
|
||||
python -m build --wheel --outdir ./
|
||||
delocate-wheel trexio-*.whl
|
||||
working-directory: python
|
||||
|
||||
- name: Upload produced wheels as artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: pytrexio-${{ matrix.os }}
|
||||
path: ./*.whl
|
||||
working-directory: python
|
||||
|
||||
|
||||
publish_wheels:
|
||||
|
Loading…
Reference in New Issue
Block a user