deprecate python 3.7 #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test code | |
on: [push] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ["3.8", "3.9", "3.10"] | |
defaults: # Needed for conda | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
activate-environment: ffevaluate | |
environment-file: conda-environment.yml | |
python-version: ${{ matrix.python-version }} | |
uses-mamba: true | |
miniforge-variant: Mambaforge | |
channels: acellera,conda-forge,defaults | |
- name: Install pip dependencies | |
run: | | |
pip install flake8 pytest | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Insert placeholder values | |
run: | | |
python ci/insert_placeholder_values.py | |
- name: Define conda-build env vars | |
if: startsWith(github.ref, 'refs/tags') | |
run: | | |
echo "BUILD_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
echo "BUILD_NUMBER=0" >> $GITHUB_ENV | |
- name: Build and install conda package | |
run: | | |
mamba install conda-build=3 boa -c conda-forge | |
conda mambabuild --python ${{ matrix.python-version }} package/ffevaluation --no-include-recipe -c acellera -c conda-forge | |
mamba install /usr/share/miniconda3/envs/ffevaluate/conda-bld/linux-64/ffevaluation-[0-9]*.tar.bz2 -y -q -c acellera -c conda-forge | |
- name: Run tests and coverage | |
run: | | |
pip install -q codecov coverage | |
coverage run -m unittest discover --start-directory ./ffevaluation --pattern "*.py" | |
codecov | |
- name: Upload to anaconda | |
if: startsWith(github.ref, 'refs/tags') | |
run: | | |
mamba install anaconda-client | |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload /usr/share/miniconda3/envs/ffevaluate/conda-bld/linux-64/ffevaluation-[0-9]*.tar.bz2 -u acellera |