-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Circle Ci to the template (#306)
- Loading branch information
Showing
15 changed files
with
171 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
src/scicookie/{{cookiecutter.project_slug}}/.circleci/config.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
version: 2.1 # Adjust if needed based on CircleCI requirements | ||
executors: | ||
default_image: | ||
docker: | ||
{%- if cookiecutter.use_conda == "yes" %} | ||
- image: continuumio/miniconda3 | ||
jobs: | ||
check-branch: | ||
executor: default_image | ||
steps: | ||
- checkout | ||
test: | ||
docker: | ||
- image: continuumio/miniconda3 | ||
steps: | ||
- checkout | ||
- run: | ||
name: Create environment | ||
command: | | ||
conda env create -f conda/dev.yaml | ||
conda init bash | ||
source ~/.bashrc | ||
conda activate {{ cookiecutter.project_slug }} | ||
{%- else %} | ||
- image: cimg/python:3.10 # Adjust Python version if needed | ||
jobs: | ||
check-branch: | ||
executor: default_image | ||
steps: | ||
- checkout | ||
test: | ||
executor: default_image | ||
steps: | ||
- checkout | ||
- run: | ||
name: Create environment and install dependencies | ||
command: | | ||
python -m pip install -r requirements.txt | ||
{%- endif %} | ||
{%- if cookiecutter.build_system == "poetry" %} | ||
poetry install | ||
{%- elif cookiecutter.build_system == "flit" %} | ||
flit install | ||
{%- elif cookiecutter.build_system == "pdm" %} | ||
pdm install | ||
{%- else %} | ||
pip install . | ||
{%- endif %} | ||
export PATH=$PATH:/home/circleci/.pyenv/versions/3.10.15/bin; | ||
{%- if cookiecutter.use_pre_commit == "yes" %} | ||
pre-commit install | ||
{%- endif %} | ||
{%- if cookiecutter.use_makim == "yes" %} | ||
makim tests.unit | ||
makim tests.linter | ||
{%- endif %} | ||
{%- if cookiecutter.use_make == "yes" %} | ||
make test | ||
make lint | ||
{%- endif %} | ||
{%- if cookiecutter.use_conda == "yes" %} | ||
- save_cache: | ||
paths: | ||
- ~/.conda/envs/{{ cookiecutter.project_slug }} | ||
key: conda-{% raw %}{{ checksum "conda/dev.yaml" }}{% endraw %} | ||
{%- endif %} | ||
workflows: | ||
main: | ||
jobs: | ||
- check-branch: | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
tags: {} | ||
- test: | ||
filters: | ||
branches: | ||
only: | ||
- main | ||
tags: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
SMOKE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
# run the complete smoke tests | ||
. ${SMOKE_DIR}/base.sh "use_circleci=yes use_conda=yes" | ||
. ${SMOKE_DIR}/base.sh "use_circleci=yes use_pyenv=yes" | ||
|
||
# check the CI files from template | ||
. ${SMOKE_DIR}/base-template.sh "use_circleci=yes use_conda=yes" | ||
pushd /tmp/osl/osl-python-package | ||
circleci config validate | ||
popd | ||
|
||
. ${SMOKE_DIR}/base-template.sh "use_circleci=yes use_pyenv=yes" | ||
pushd /tmp/osl/osl-python-package | ||
circleci config validate | ||
popd |