Skip to content

[Setup.py] [2/n] Add dependencies for multipy runtime build from setup.py. #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 55 additions & 6 deletions .github/workflows/package_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

schedule:
- cron: '0 2 * * *' # run at 2 AM UTC
workflow_dispatch:

jobs:
unittest:
Expand All @@ -16,36 +17,84 @@ jobs:
python-major-version: [3]
python-minor-version: [7,8,9]
platform: [ubuntu-18.04]
include:
- python-major-version: 3
python-minor-version: 9
platform: macos-latest
# include:
# - python-major-version: 3
# python-minor-version: 9
# platform: macos-latest
fail-fast: false
runs-on: ${{ matrix.platform }}
steps:
- name: Set Python Version
run: |
echo "python-version=${{ matrix.python-major-version }}.${{ matrix.python-minor-version }}" >> $GITHUB_ENV

- name: Setup Python ${{ env.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.python-version }}
architecture: x64

- name: Checkout MultiPy
uses: actions/checkout@v2

- name: Install runtime build dependencies
run: |
set -eux
sudo apt update
xargs sudo apt install -y -qq --no-install-recommends <build-requirements.txt

- name: Update cmake
run: |
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo gpg --dearmor -o /usr/share/keyrings/magic-key.gpg
echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/magic-key.gpg] https://apt.kitware.com/ubuntu/ bionic main" | sudo tee -a /etc/apt/sources.list
echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install -y binutils cmake

- name: Set up virtual environment
run: |
set -eux
git submodule update --init --recursive --jobs 0
pip3 install virtualenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
export CFLAGS="-fPIC -g"
declare -A py_version_dict
py_version_dict[7]='3.7.10'
py_version_dict[8]='3.8.13'
py_version_dict[9]='3.9.13'
py_version_dict[10]='3.10.6'
py_install_version=${py_version_dict[${{ matrix.python-minor-version }}]}
~/.pyenv/bin/pyenv install --force ${py_install_version}
virtualenv -p ~/.pyenv/versions/${py_install_version}/bin/python3 ~/venvs/multipy

- name: Install dependencies
run: |
set -eux
source ~/venvs/multipy/bin/activate
pip install -r dev-requirements.txt
deactivate

- name: Run setup.py
run: |
set -eux
source ~/venvs/multipy/bin/activate
python setup.py install
deactivate

- name: Run tests
run: coverage run -m unittest discover --verbose --start-directory multipy/test/package/ --pattern "test_*"
run: |
set -eux
source ~/venvs/multipy/bin/activate
coverage run -m unittest discover --verbose --start-directory multipy/test/package/ --pattern "test_*"
deactivate

- name: Coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
set -eux
source ~/venvs/multipy/bin/activate
coverage report -m
coverage xml

codecov
deactivate
37 changes: 37 additions & 0 deletions build-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
build-essential
ca-certificates
ccache
curl
wget
git
libjpeg-dev
xz-utils
bzip2
libbz2-dev
liblzma-dev
libreadline6-dev
libexpat1-dev
libgdbm-dev
glibc-source
libgmp-dev
libffi-dev
libgl-dev
ncurses-dev
libncursesw5-dev
libncurses5-dev
gnome-panel
libssl-dev
tcl-dev
tix-dev
libgtest-dev
tk-dev
libsqlite3-dev
zlib1g-dev
llvm
python-openssl
apt-transport-https
ca-certificates
gnupg
software-properties-common
python-pip
python3-pip