Skip to content

CI

CI #320

Workflow file for this run

name: CI
on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# Existing codes likely still have "master" as the primary branch
# Both are tracked here to keep legacy and new codes working
push:
branches:
- "*"
- "**"
pull_request:
branches:
- "master"
- "update"
schedule:
# Nightly tests run on master by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * *"
jobs:
linux:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install gfortran
- run: gfortran --version
windows:
runs-on: windows-latest
steps:
- run: choco install mingw
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
# Not relevant now, but may be needed when f2py issues are solved, for now only numba
# - name: Set up msys for Windows
# if: matrix.os == 'windows-latest'
# uses: msys2/setup-msys2@v2
# with:
# update: true
# install: >-
# mingw-w64-x86_64-gcc-fortran
# mingw-w64-x86_64-gcc
- uses: actions/checkout@v2
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Testing Dependencies
shell: bash -l {0}
run: |
python -m pip install -U pytest pytest-cov codecov
- name: Install gfortran on mac
if: matrix.os == 'macOS-latest'
shell: bash -l {0}
run: |
conda install -c conda-forge gfortran_osx-64
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps -vvv
conda list
- name: Run tests
shell: bash -l {0}
run: |
ls -a despasito/equations_of_state/saft/compiled_modules
pytest -vvv --cov=despasito --cov-report=xml --color=yes despasito/tests/
- name: CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}