diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..2e6dc7b --- /dev/null +++ b/.circleci/config.yml @@ -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