Skip to content

Commit

Permalink
Change actions for mamba / pip install methods.
Browse files Browse the repository at this point in the history
for mamba: use mamba-org/provision-with-micromamba
for pip: use actions/setup-python
  • Loading branch information
nbiederbeck committed Jan 11, 2023
1 parent 900631e commit 7f02e7e
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
include:
- os: ubuntu-latest
python-version: "3.8"
install-method: conda
install-method: mamba

- os: ubuntu-latest
python-version: "3.9"
install-method: conda
install-method: mamba

- os: ubuntu-latest
python-version: "3.10"
install-method: conda
install-method: mamba
codecov: true

- os: ubuntu-latest
Expand All @@ -39,15 +39,15 @@ jobs:

- os: macos-latest
python-version: "3.10"
install-method: conda
install-method: mamba

- os: macos-latest
python-version: "3.8"
install-method: pip

defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}

steps:
- uses: actions/checkout@v3
Expand All @@ -60,36 +60,28 @@ jobs:
path: ~/.cache/ctapipe
key: ctapipe-test-data

- name: Prepare conda installation
if: matrix.install-method == 'conda'
- name: Prepare mamba installation
if: matrix.install-method == 'mamba'
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
# fix mamba error that the directory does not exist
mkdir -p ~/conda_pkgs_dir/cache
# setup correct python version
sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml
- name: Conda setup
if: matrix.install-method == 'conda'
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
auto-update-conda: true
activate-environment: "cta-dev"
environment-file: environment.yml
- name: mamba setup
if: matrix.install-method == 'mamba'
uses: mamba-org/provision-with-micromamba@v14

- name: Python setup
if: matrix.install-method == 'pip'
uses: conda-incubator/setup-miniconda@v2
uses: actions/setup-python@v4
with:
mamba-version: "*"
channels: conda-forge,default
python-version: ${{ matrix.python-version }}
check-latest: true

- name: Update pip
if: matrix.install-method == 'pip'
run: pip install -U pip
run: python -m pip install -U pip

- name: Install dependencies
run: |
Expand All @@ -99,14 +91,10 @@ jobs:
pip freeze
- name: Static codechecks
# need to use a login shell for the conda setup to work
shell: bash -leo pipefail {0}
run: |
flake8 ctapipe
- name: Tests
# need to use a login shell for the conda setup to work
shell: bash -leo pipefail {0}
run: |
cd $(mktemp -d)
pytest -n auto --dist loadscope \
Expand Down Expand Up @@ -147,7 +135,7 @@ jobs:
- name: Build docs
run: make doc

- name: Deploy to gihub pages
- name: Deploy to github pages
# only run on push to master
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: JamesIves/github-pages-deploy-action@3.7.1
Expand Down

0 comments on commit 7f02e7e

Please sign in to comment.