Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Conda-app.yml #682

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 44 additions & 49 deletions .github/workflows/Conda-app.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,56 @@
name: Conda package

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
push:
branches: [main]

jobs:
ci:
name: "CI setup"

strategy:
fail-fast: false
matrix:
python-version:
- "3.12"
- "3.11"
- "3.10"

os:
- "ubuntu-latest"

runs-on: "${{ matrix.os }}"

# use bash everywhere
mypy:
runs-on: ubuntu-latest
defaults:
run:
shell: "bash -l {0}"

shell: bash -l {0}
steps:
- name: "Checkout code"
uses: "actions/checkout@v4"

- name: Install opencv dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-glx libegl1-mesa
sudo apt-get install -y python3-opencv

- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Cache conda
uses: actions/cache@v4
env:
# Increase this value to reset cache if environment-test.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-py39-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('environment.yml') }}
- name: Cache multiple paths
uses: actions/cache@v4
env:
# Increase this value to reset cache if requirements.txt has not changed
CACHE_NUMBER: 0
with:
path: |
~/.cache/pip
$RUNNER_TOOL_CACHE/Python/*
~\AppData\Local\pip\Cache
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
environment-name: DeepForest
miniforge-variant: Mambaforge
miniforge-version: latest
mamba-version: "*"
activate-environment: DeepForest
channel-priority: strict
environment-file: environment.yml
create-args: "python=${{ matrix.python-version }}"
cache-environment: true
cache-downloads: true

- name: Run pytest
run: pytest -v

- name: Check style
run: yapf -d --recursive deepforest/ --style=.style.yapf

- name: Check notebook build
run: pytest --nbmake docs/*.ipynb

- name: Test Docs
python-version: "3.10" # Run pre-commit on oldest supported Python version
use-mamba: true
use-only-tar-bz2: false # IMPORTANT: This may break caching of conda packages! See https://github.com/conda-incubator/setup-miniconda/issues/267
- name: Install-pymc and mypy dependencies
run: |
conda activate DeepForest
pip install -e .
python --version
- name: Run Pytest
run: |
cd docs && make clean && make html SPHINXOPTS="-W"
conda activate DeepForest
python pytest -v
Loading