Skip to content

Commit

Permalink
Migrate to GitHub Actions
Browse files Browse the repository at this point in the history
- Build scripts updated
- setup.py: Handle version string from GITHUB_REF
- Adjust some deprecated code
- Although disabled in CI, conda-build was migrated to boa/mamba,
  and conda-forge is used since Python 3.10 is somewhat broken in
  the oficial conda repos. Still too slow to build on every commit.
- An older macOS SDK is used to avoid some linker issues.
- LICENSE: updated to 2022
- README.md: replace badges
  • Loading branch information
PMeira committed Jan 1, 2022
1 parent 14f4892 commit 9c4479e
Show file tree
Hide file tree
Showing 27 changed files with 269 additions and 384 deletions.
175 changes: 175 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
name: Builds

# TODO: generalize steps

env:
DSS_CAPI_TAG: 0.12.0a1
ARTIFACTS_FOLDER: '${{ github.workspace }}/artifacts'

on:
# release:
# types: [created]
push:

jobs:
build_linux_x64:
name: 'Linux x64'
runs-on: ubuntu-latest
container:
image: 'docker://pmeira/manylinux_wheel_fpc322_x86_64'
env:
CONDA_SUBDIR: 'linux-64'
DSS_CAPI_PATH: '${{ github.workspace }}/dss_capi'
CONDA: "/opt/miniconda/"
steps:
- name: 'Checkout'
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY dss_python
cd dss_python
git checkout $GITHUB_SHA
- name: 'Download/extract DSS C-API binaries'
run: |
curl -s -L https://github.com/dss-extensions/dss_capi/releases/download/${DSS_CAPI_TAG}/dss_capi_${DSS_CAPI_TAG}_linux_x64.tar.gz -o dss_capi.tar.gz
tar zxf dss_capi.tar.gz
- name: Build wheel
run: |
mkdir -p artifacts
mkdir -p artifacts_raw
bash dss_python/ci/build_linux.sh x64
# - name: Build conda packages
# continue-on-error: true
# run: |
# bash dss_python/ci/build_conda.sh
- name: 'Upload artifacts'
uses: "actions/upload-artifact@v2"
with:
name: 'packages'
path: '${{ github.workspace }}/artifacts'

build_linux_x86:
name: 'Linux x86'
runs-on: ubuntu-latest
env:
CONDA_SUBDIR: 'linux-32'
DOCKER_IMAGE: 'pmeira/manylinux_wheel_fpc322_i686'
steps:
- name: 'Checkout'
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY dss_python
cd dss_python
git checkout $GITHUB_SHA
- name: 'Setup Docker'
run: |
docker pull $DOCKER_IMAGE
- name: 'Download/extract DSS C-API binaries'
run: |
curl -s -L https://github.com/dss-extensions/dss_capi/releases/download/${DSS_CAPI_TAG}/dss_capi_${DSS_CAPI_TAG}_linux_x86.tar.gz -o dss_capi.tar.gz
tar zxf dss_capi.tar.gz
- name: Build wheel
run: |
mkdir -p artifacts
mkdir -p artifacts_raw
docker run -e GITHUB_SHA -e GITHUB_REF -e DSS_CAPI_PATH=/build/dss_capi -v "${PWD}:/build" -w /build $DOCKER_IMAGE bash /build/dss_python/ci/build_linux.sh x86
- name: 'Upload artifacts'
uses: "actions/upload-artifact@v2"
with:
name: 'packages'
path: '${{ github.workspace }}/artifacts'

build_macos_x64:
name: 'macOS x64'
runs-on: 'macos-10.15'
env:
DSS_CAPI_PATH: '${{ github.workspace }}/dss_capi'
SDKROOT: '${{ github.workspace }}/MacOSX10.13.sdk'
PYTHON: python3
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
path: 'dss_python'
- name: 'Download/extract DSS C-API binaries'
run: |
curl -s -L https://github.com/dss-extensions/dss_capi/releases/download/${DSS_CAPI_TAG}/dss_capi_${DSS_CAPI_TAG}_darwin_x64.tar.gz -o dss_capi.tar.gz
tar zxf dss_capi.tar.gz
- name: 'Download macOS SDK 10.13'
run: |
curl -s -L https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz -o macOSsdk.tar.xz
tar xf macOSsdk.tar.xz
- name: Build wheel
run: |
bash dss_python/ci/build_wheel.sh
# - name: Build conda packages
# continue-on-error: true
# run: |
# sudo chown -R $UID $CONDA
# bash dss_python/ci/build_conda.sh
- name: 'Upload artifacts'
uses: "actions/upload-artifact@v2"
with:
name: 'packages'
path: '${{ github.workspace }}/artifacts'

build_win_x64:
name: 'Windows x64'
runs-on: windows-2019
env:
CONDA_SUBDIR: 'win-64'
DSS_CAPI_PATH: '${{ github.workspace }}\dss_capi'
PYTHON: python
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
path: 'dss_python'
- name: 'Download/extract DSS C-API binaries'
shell: cmd
run: |
"c:\Program Files\Git\mingw64\bin\curl" -s -L https://github.com/dss-extensions/dss_capi/releases/download/%DSS_CAPI_TAG%/dss_capi_%DSS_CAPI_TAG%_win_x64.zip -o dss_capi.zip
7z x -y -o. dss_capi.zip
- name: Build wheel
shell: bash
run: |
bash dss_python/ci/build_wheel.sh
# - name: Build conda packages
# continue-on-error: true
# shell: bash
# run: |
# bash dss_python/ci/build_conda.sh
- name: 'Upload artifacts'
uses: "actions/upload-artifact@v2"
with:
name: 'packages'
path: '${{ github.workspace }}/artifacts'

build_win_x86:
name: 'Windows x86'
runs-on: windows-2019
env:
CONDA_SUBDIR: 'win-32'
DSS_CAPI_PATH: '${{ github.workspace }}\dss_capi'
PYTHON: python
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
path: 'dss_python'
- uses: actions/setup-python@v2
with:
python-version: '3.6'
architecture: 'x86'
- name: 'Download/extract DSS C-API binaries'
shell: cmd
run: |
"c:\Program Files\Git\mingw64\bin\curl" -s -L https://github.com/dss-extensions/dss_capi/releases/download/%DSS_CAPI_TAG%/dss_capi_%DSS_CAPI_TAG%_win_x86.zip -o dss_capi.zip
7z x -y -o. dss_capi.zip
- name: Build wheel
shell: bash
run: |
bash dss_python/ci/build_wheel.sh
- name: 'Upload artifacts'
uses: "actions/upload-artifact@v2"
with:
name: 'packages'
path: '${{ github.workspace }}/artifacts'

84 changes: 0 additions & 84 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
BSD 3-Clause License

Copyright (c) 2017-2020, Paulo Meira
Copyright (c) 2017-2022, Paulo Meira
Copyright (c) 2017-2022, DSS Python contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Travis-CI: Linux and macOS build status](https://travis-ci.com/dss-extensions/dss_python.svg?branch=0.10.x)](https://travis-ci.com/dss-extensions/dss_python)
[![AppVeyor: Windows build status](https://ci.appveyor.com/api/projects/status/bvcbel63n5uf4yjk/branch/0.10.x?svg=true)](https://ci.appveyor.com/project/PMeira/dss-python-yyx2r/branch/0.10.x)
[![Builds](https://github.com/dss-extensions/dss_python/actions/workflows/builds.yml/badge.svg)](https://github.com/dss-extensions/dss_python/actions/workflows/builds.yml)
[![PyPI](https://img.shields.io/pypi/v/dss_python)](https://pypi.org/project/dss-python/)
[![Install with conda](https://anaconda.org/dss-extensions/dss_python/badges/installer/conda.svg)](https://anaconda.org/dss-extensions/dss_python)
[![conda package version](https://anaconda.org/dss-extensions/dss_python/badges/version.svg)](https://anaconda.org/dss-extensions/dss_python)
Expand Down
17 changes: 0 additions & 17 deletions appveyor.yml

This file was deleted.

54 changes: 0 additions & 54 deletions ci/build_appveyor.bat

This file was deleted.

32 changes: 32 additions & 0 deletions ci/build_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cd dss_python

if [ "$RUNNER_OS" = "Windows" ]; then
CONDA=`cygpath "$CONDA"`
export ARTIFACTS_FOLDER=`readlink -f ../artifacts`
fi

export PATH=$CONDA:$CONDA/bin:$CONDA/scripts:$PATH
export DSS_PYTHON_MANYLINUX=0

source $CONDA/etc/profile.d/conda.sh

# Update the recipe
DSS_PYTHON_PREPARE_BOA=1 python setup.py

conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda create -p ../boa boa anaconda-client
conda activate boa

PYTHON_VERSIONS="3.6 3.7 3.8 3.9 3.10"
for pyversion in $PYTHON_VERSIONS
do
# Workaround to build when a single version fails
echo "python:" > conda/version.yaml
echo " - $pyversion" >> conda/version.yaml
boa build --no-test conda -m conda/version.yaml
done

#boa build --no-test conda -m conda/conda_build_config.yaml

mv $CONDA/conda-bld/*-64 $ARTIFACTS_FOLDER/
Loading

0 comments on commit 9c4479e

Please sign in to comment.