Skip to content

osx test

osx test #560

Workflow file for this run

name: build
on: [push]
jobs:
build:
name: build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
python-version: [3.8]
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: test
auto-activate-base: false
- name: Install essential
run: |
sudo apt update
sudo apt install build-essential
- name: Install conda packages
run: |
conda activate test
conda install -c anaconda cmake
conda install mpi4py h5py pytorch==2.0.0 torchvision==0.15.0 cpuonly -c pytorch -c conda-forge
conda install -c conda-forge libstdcxx-ng
conda install -c anaconda gxx_linux-64
- name: Install the package
run: python -m pip install .[test,hpc]
env:
CONDA_PREFIX: /usr/share/miniconda
- name: Test with multithreading
env:
CONDA_PREFIX: /usr/share/miniconda
run: mpirun -np 2 coverage run -m pytest tests_hvd
- name: Test with single thread
env:
CONDA_PREFIX: /usr/share/miniconda
run: coverage run -m pytest tests
- name: Combine all coverage results
run: coverage combine
- run: coverage report
- name: Coveralls Parallel
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}
COVERALLS_PARALLEL: true
finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true