Skip to content

don't error out on machines without internet #342

don't error out on machines without internet

don't error out on machines without internet #342

name: Test and deploy code
on: [push]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
"ubuntu-latest",
# "macos-latest",
"macos-13",
"windows-2019",
]
python-version: ["3.9", "3.10", "3.11", "3.12"]
defaults: # Needed for conda
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
lfs: true
submodules: true
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
channels: acellera,conda-forge,defaults
- name: Install Linux HTMD conda deps
if: matrix.os != 'windows-2019'
run: |
conda install --file package/htmd/DEPENDENCIES python=${{ matrix.python-version }} -y
- name: Install Windows HTMD conda deps
if: matrix.os == 'windows-2019'
run: |
conda install --file package/htmd/DEPENDENCIES_WIN python=${{ matrix.python-version }} -y
- name: List installed packages
run: conda list
- name: Install pip dependencies
run: |
pip install flake8 pytest
pip install .
- 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: Test
run: |
export HTMD_NONINTERACTIVE=1
pytest --verbose --durations=10 ./htmd/
deploy:
if: startsWith(github.event.ref, 'refs/tags/')
needs: test
runs-on: ${{ matrix.os }}
defaults: # Needed for conda
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-2019", "macos-13"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
python-version: ${{ matrix.python-version }}
channels: acellera,conda-forge,defaults
- name: Dump Linux dependencies yaml file
if: matrix.os != 'windows-2019'
run: |
pip install versioneer==0.28 pyyaml
python package/htmd/insert_placeholder_values.py package/htmd/DEPENDENCIES
- name: Dump Windows dependencies yaml file
if: matrix.os == 'windows-2019'
run: |
pip install versioneer==0.28 pyyaml
python package/htmd/insert_placeholder_values.py package/htmd/DEPENDENCIES_WIN
- name: Build htmd conda package
run: |
conda install anaconda-client rattler-build python=${{ matrix.python-version }}
rattler-build build --recipe ./package/htmd/recipe.yaml --output-dir /tmp/pkg/ --no-include-recipe -c acellera -c conda-forge
- name: Upload to conda
run: |
anaconda -t ${{ secrets.ANACONDA_TOKEN_BASIC }} upload -u acellera /tmp/pkg/*/htmd-*.conda