Skip to content

Bump actions/upload-artifact from 3 to 4 #51

Bump actions/upload-artifact from 3 to 4

Bump actions/upload-artifact from 3 to 4 #51

Workflow file for this run

name: Build dependencies
on:
workflow_dispatch:
pull_request:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
HIGHFIVE_VERSION: "2.7.1"
BOOST_VERSION: "1.83.0"
EIGEN_VERSION: "3.4.0"
HDF5_VERSION: "1.14.2"
LIBINT_VERSION: "2.7.2"
GMP_VERSION: "6.3.0"
jobs:
build_linux:
name: Build ${{ matrix.platform }} dependencies
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- manylinux1_x86_64
- manylinux2010_x86_64
- manylinux2014_x86_64
- manylinux_2_28_x86_64
- manylinux2014_aarch64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set image tag
run: |
case "${{ github.event_name }}" in
"release")
echo "TAG1=${{ github.ref_name }}" >> $GITHUB_ENV
echo "TAG2=latest" >> $GITHUB_ENV
;;
*)
echo "TAG1=dev0" >> $GITHUB_ENV
echo "TAG2=dev0" >> $GITHUB_ENV
;;
esac
- name: Set up QEMU
if: matrix.platform == 'manylinux2014_aarch64'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Publish Image
uses: matootie/[email protected]
with:
accessToken: ${{ secrets.GITHUB_TOKEN }}
imageName: ${{ matrix.platform }}-qmflows
containerRegistry: true
contextName: ./manylinux.dockerfile
tag: |
${{ env.TAG1 }}
${{ env.TAG2 }}
buildArgs: |
platform=${{ matrix.platform }}
highfive_version=${{ env.HIGHFIVE_VERSION }}
boost_version=${{ env.BOOST_VERSION }}
eigen_version=${{ env.EIGEN_VERSION }}
hdf5_version=${{ env.HDF5_VERSION }}
libint_version=${{ env.LIBINT_VERSION }}
gmp_version=${{ env.GMP_VERSION }}
build_macos_x86_64:
name: Build macosx_x86_64 dependencies
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: "10.14"
CC: "/usr/bin/clang"
CXX: "/usr/bin/clang++"
CXXFLAGS: "-std=c++11"
PREFIX: ${{github.workspace}}/macosx_x86_64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: pip install -e .
- name: Python info
run: |
which python
python --version
- name: Installed packages
run: pip list
- name: Create output directories
run: |
mkdir -p $PREFIX/lib
mkdir -p $PREFIX/bin
mkdir -p $PREFIX/include
cp -r licenses $PREFIX/licenses
- name: Install Automake
run: |
brew update
brew install automake
- name: Install HighFive
run: python tools/install_highfive.py $HIGHFIVE_VERSION --prefix=$PREFIX
- name: Install Boost
run: python tools/install_boost.py $BOOST_VERSION --prefix=$PREFIX
- name: Install Eigen
run: python tools/install_eigen.py $EIGEN_VERSION --prefix=$PREFIX
- name: Install HDF5
run: |
python tools/install_hdf5.py $HDF5_VERSION --prefix=$PREFIX --libdir=/usr/local/lib
cp /usr/local/lib/libhdf5* $PREFIX/lib/
- name: Install Libint
run: |
cp -r $PREFIX/include/* /usr/local/include/
python tools/install_libint.py $LIBINT_VERSION --prefix=$PREFIX --libdir=/usr/local/lib
cp /usr/local/lib/libint2* $PREFIX/lib/
- name: Create archive
run: tar -czvf $PREFIX.tar.gz macosx_x86_64
- uses: actions/upload-artifact@v4
with:
name: deps
path: macosx_*.tar.gz
upload_artifacts:
name: Attach artifacts to release
runs-on: ubuntu-latest
needs: [build_macos_x86_64]
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v3
with:
name: deps
path: output
- name: Attach artifacts to GitHub release
uses: AButler/[email protected]
with:
files: 'output/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python on ubuntu-latest
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install linters
run: pip install .[lint]
- name: Python info
run: |
which python
python --version
- name: Installed packages
run: pip list
- name: Run pydocstyle
run: pydocstyle dep_builder
- name: Run flake8
run: flake8 dep_builder tools
- name: Run mypy
run: mypy dep_builder tools