Skip to content

Commit

Permalink
Merge pull request #81 from oberbichler/feature/refactor-ci
Browse files Browse the repository at this point in the history
Refactor CI
  • Loading branch information
oberbichler authored Jun 14, 2020
2 parents 27b3906 + f32588d commit 0fec62e
Showing 1 changed file with 23 additions and 55 deletions.
78 changes: 23 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,86 +3,54 @@ name: CI
on: [push]

jobs:
build_windows_conda:
name: build (windows-latest, conda)
runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
call %CONDA%/Scripts/activate.bat
conda install mkl-devel & python -m pip install --upgrade pip & pip install -r requirements.txt & pip install hyperjet
shell: cmd
- name: Install package
run: |
call %CONDA%/Scripts/activate.bat
pip install .
shell: cmd
- name: Test with pytest
run: |
call %CONDA%/Scripts/activate.bat
pip install pytest
pytest
shell: cmd

build_linux:
name: build (${{ matrix.os }}, conda)
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: |
source $CONDA/bin/activate
conda install mkl-devel
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install hyperjet
- name: Install package
run: |
source $CONDA/bin/activate
pip install .
- name: Test with pytest
run: |
source $CONDA/bin/activate
pip install pytest
pytest
build:
runs-on: ${{ matrix.os }}

strategy:
max-parallel: 4
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: [3.6, 3.7, 3.8]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install libomp
run: |
brew install libomp
if: matrix.os == 'macos-latest'

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install hyperjet
- name: Install package
run: |
$env:MKL_ROOT=python -c "from sysconfig import get_paths as gp; print(gp()['data'])"
pip install .
python -c "import eqlib; print(eqlib._USE_MKL)"
python -c "import eqlib; print('eqlib._USE_MKL', eqlib._USE_MKL)"
shell: pwsh

- name: Test with pytest
run: |
pip install pytest
pytest
pytest

0 comments on commit 0fec62e

Please sign in to comment.