Skip to content

Commit 0f47a63

Browse files
committed
setup build and test in circle CI
1 parent 840584e commit 0f47a63

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.circleci/config.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
version: 2.1
2+
3+
orbs:
4+
# The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files
5+
# Orb commands and jobs help you with common scripting around a language/tool
6+
# so you dont have to copy and paste it everywhere.
7+
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python
8+
python: circleci/python@1.2
9+
10+
workflows:
11+
build-and-test: # This is the name of the workflow, feel free to change it to better match your workflow.
12+
# Inside the workflow, you define the jobs you want to run.
13+
# For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows
14+
jobs:
15+
- build-and-test
16+
17+
18+
jobs:
19+
build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do!
20+
# These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/
21+
# You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub
22+
# A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python
23+
# The executor is the environment in which the steps below will be executed - below will use a python 3.9 container
24+
# Change the version below to your required version of python
25+
docker:
26+
- image: ubuntu:bionic
27+
environment:
28+
CONDA_PREFIX: /root/tools/miniconda3
29+
user: root
30+
working_directory: /root/tools/PyAPS
31+
# Checkout the code as the first step. This is a dedicated CircleCI step.
32+
steps:
33+
- checkout
34+
- run:
35+
name: Setting Environment with Miniconda
36+
command: |
37+
apt update
38+
apt-get update --yes && apt-get upgrade --yes
39+
apt-get install --yes wget
40+
# download and install miniconda3
41+
mkdir -p ${HOME}/tools
42+
cd ${HOME}/tools
43+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
44+
bash Miniconda3-latest-Linux-x86_64.sh -b -p ${HOME}/tools/miniconda3
45+
${HOME}/tools/miniconda3/bin/conda init bash
46+
${HOME}/tools/miniconda3/bin/conda config --add channels conda-forge
47+
${HOME}/tools/miniconda3/bin/conda install -c conda-forge --yes mamba
48+
- run:
49+
name: Installing PyAPS
50+
no_output_timeout: 10m
51+
command: |
52+
export PYTHONUNBUFFERED=1
53+
# setup environment variable
54+
export PATH=${CONDA_PREFIX}/bin:${PATH}
55+
# install dependencies
56+
source activate root
57+
mamba install --verbose --yes fortran-compiler --file ${HOME}/tools/PyAPS/requirements.txt
58+
python -m pip install ${HOME}/tools/PyAPS
59+
60+
- run:
61+
name: Test the Installation
62+
command: |
63+
# setup environment variables
64+
export PATH=${CONDA_PREFIX}/bin:${PATH}
65+
# run tests
66+
python ${HOME}/tools/PyAPS/tests/test_calc.py
67+

0 commit comments

Comments
 (0)