Skip to content

Commit

Permalink
Fixes GitHub actions by switching to mama environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuihantao committed Dec 8, 2023
1 parent e89b26d commit fd334b5
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,40 @@ on: [push, pull_request]

jobs:
build:

name: ANDES Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.11
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.11
- name: Install dependencies
mamba-version: "*"
miniforge-version: "latest"
channels: conda-forge,defaults
channel-priority: true
activate-environment: anaconda-client-env
- shell: bash -el {0}
name: Install dependencies
run: |
# work around a pip issue with extras_require: https://github.com/pypa/pip/issues/8323
python -m pip install -U "pip @ git+https://github.com/pypa/pip.git"
python -m pip install --upgrade pip
python -m pip install .[all]
python -m pip install nbmake pytest-xdist line_profiler # add'l packages for notebook tests.
- name: Lint with flake8 for pull requests
mamba install -y nbmake pytest-xdist line_profiler # add'l packages for notebook tests.
mamba install --file requirements.txt --file requirements-extra.txt
python -m pip install -e .
- shell: bash -el {0}
name: Lint with flake8 for pull requests
if: github.event_name == 'pull_request'
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 .
- name: Test with pytest
- shell: bash -el {0}
name: Test with pytest
run: |
pytest --log-cli-level=10
- name: Test notebooks.
pytest
- shell: bash -el {0}
name: Test notebooks.
run: |
pytest --log-cli-level=10 --nbmake examples --ignore=examples/verification
- name: Build a distribution if tagged
pytest --nbmake examples --ignore=examples/verification
- shell: bash -el {0}
name: Build a distribution if tagged
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
python setup.py sdist
Expand All @@ -40,4 +46,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
password: ${{ secrets.pypi_password }}

0 comments on commit fd334b5

Please sign in to comment.