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

ADD: Adding circleci #27

Merged
merged 1 commit into from
Sep 14, 2024
Merged
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
71 changes: 71 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
version: 2.1

jobs:
lint:
docker:
- image: circleci/python:3.12
steps:
- checkout
- run:
name: Install dependencies
command: |
python -m pip install --upgrade pip
pip install black black[jupyter] ruff
- run:
name: Black style check
command: |
black --check .
- run:
name: Lint with ruff
command: |
ruff check .

test:
docker:
- image: circleci/python:3.12
steps:
- checkout
- run:
name: Install micromamba
command: |
curl micro.mamba.pm/install.sh | bash
- run:
name: Create conda environment
command: |
micromamba create --yes --name radarx-env python=3.12 numpy
- run:
name: Activate environment and install dependencies
command: |
source ~/micromamba/etc/profile.d/micromamba.sh
micromamba activate radarx-env
python -m pip install . --no-deps
python -m pip install pytest pytest-cov
- run:
name: Run tests with coverage
command: |
source ~/micromamba/etc/profile.d/micromamba.sh
micromamba activate radarx-env
pytest --cov=radarx --cov-report=xml tests/
- store_artifacts:
path: coverage.xml
destination: coverage.xml

upload_coverage:
docker:
- image: circleci/python:3.12
steps:
- checkout
- run:
name: Upload coverage to Codecov
command: |
bash <(curl -s https://codecov.io/bash) -f coverage.xml -t $CODECOV_TOKEN

workflows:
version: 2
lint_test:
jobs:
- lint
- test
- upload_coverage:
requires:
- test