Skip to content

Commit

Permalink
Activate venv for later steps and remove all conda dependencies (#413)
Browse files Browse the repository at this point in the history
* Persist venv across job steps
* Update codecov-action version
* Remove `env_config`
  • Loading branch information
lochhh authored Sep 20, 2024
1 parent 2107691 commit 1de5c25
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 159 deletions.
64 changes: 11 additions & 53 deletions .github/workflows/build_env_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch: # allows running manually from Github's 'Actions' tab

jobs:
build_env_pip_pyproject: # checks only for building env using pip and pyproject.toml
build_env_run_tests: # checks for building env using pyproject.toml and runs codebase checks and tests
name: Build env using pip and pyproject.toml on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
Expand All @@ -35,67 +35,25 @@ jobs:
pip install -e .[dev]
pip list
python -c "import aeon"
build_env_run_tests: # checks for building env using mamba and runs codebase checks and tests
name: Build env and run tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.11]
fail-fast: false
defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'cmd' || 'bash' }} -l {0}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up conda env (Linux, Windows)
if: ${{ matrix.os != 'macos-latest' }}
uses: conda-incubator/setup-miniconda@v3
with:
use-mamba: true
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
activate-environment: aeon

- name: Set up conda env (macOS)
if: ${{ matrix.os == 'macos-latest' }}
uses: conda-incubator/setup-miniconda@v2
with:
use-mamba: true
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
activate-environment: aeon
architecture: arm64
miniconda-version: "latest"

- name: Install datajoint wheel build with pip flag (macOS)
if: ${{ matrix.os == 'macos-latest' }}
run: pip install --use-pep517 datajoint git+https://github.com/datajoint-company/datajoint-utilities.git

- name: Install pyproject.toml dependencies
run: pip install -e .[dev]

# Run codebase checks and tests
- name: Activate venv for later steps
run: |
echo "VIRTUAL_ENV=$(pwd)/.venv" >> $GITHUB_ENV
echo "$(pwd)/.venv/bin" >> $GITHUB_PATH # For Unix-like systems
echo "$(pwd)/.venv/Scripts" >> $GITHUB_PATH # For Windows
# Only run codebase checks and tests for Linux (ubuntu).
- name: ruff
run: python -m ruff check .

run: ruff check .
- name: pyright
run: python -m pyright --level error --project ./pyproject.toml .

run: pyright --level error --project ./pyproject.toml .
- name: pytest
run: python -m pytest tests/ --ignore=tests/dj_pipeline

run: pytest tests/ --ignore=tests/dj_pipeline
- name: generate test coverage report
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
python -m pytest --cov=aeon tests/ --ignore=tests/dj_pipeline --cov-report=xml:tests/test_coverage/test_coverage_report.xml
- name: upload test coverage report to codecov
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: tests/test_coverage/
Expand Down
37 changes: 0 additions & 37 deletions env_config/env.yml

This file was deleted.

22 changes: 0 additions & 22 deletions env_config/env_dev.yml

This file was deleted.

11 changes: 0 additions & 11 deletions env_config/env_gpu.yml

This file was deleted.

36 changes: 0 additions & 36 deletions env_config/env_macos.yml

This file was deleted.

0 comments on commit 1de5c25

Please sign in to comment.