Skip to content

Commit

Permalink
setup build and test in circle CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yunjunz committed Nov 27, 2021
1 parent 840584e commit 0f47a63
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: 2.1

orbs:
# The python orb contains a set of prepackaged CircleCI configuration you can use repeatedly in your configuration files
# Orb commands and jobs help you with common scripting around a language/tool
# so you dont have to copy and paste it everywhere.
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python
python: circleci/python@1.2

workflows:
build-and-test: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
# For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows
jobs:
- build-and-test


jobs:
build-and-test: # This is the name of the job, feel free to change it to better match what you're trying to do!
# These next lines defines a Docker executors: https://circleci.com/docs/2.0/executor-types/
# You can specify an image from Dockerhub or use one of the convenience images from CircleCI's Developer Hub
# A list of available CircleCI Docker convenience images are available here: https://circleci.com/developer/images/image/cimg/python
# The executor is the environment in which the steps below will be executed - below will use a python 3.9 container
# Change the version below to your required version of python
docker:
- image: ubuntu:bionic
environment:
CONDA_PREFIX: /root/tools/miniconda3
user: root
working_directory: /root/tools/PyAPS
# Checkout the code as the first step. This is a dedicated CircleCI step.
steps:
- checkout
- run:
name: Setting Environment with Miniconda
command: |
apt update
apt-get update --yes && apt-get upgrade --yes
apt-get install --yes wget
# download and install miniconda3
mkdir -p ${HOME}/tools
cd ${HOME}/tools
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b -p ${HOME}/tools/miniconda3
${HOME}/tools/miniconda3/bin/conda init bash
${HOME}/tools/miniconda3/bin/conda config --add channels conda-forge
${HOME}/tools/miniconda3/bin/conda install -c conda-forge --yes mamba
- run:
name: Installing PyAPS
no_output_timeout: 10m
command: |
export PYTHONUNBUFFERED=1
# setup environment variable
export PATH=${CONDA_PREFIX}/bin:${PATH}
# install dependencies
source activate root
mamba install --verbose --yes fortran-compiler --file ${HOME}/tools/PyAPS/requirements.txt
python -m pip install ${HOME}/tools/PyAPS
- run:
name: Test the Installation
command: |
# setup environment variables
export PATH=${CONDA_PREFIX}/bin:${PATH}
# run tests
python ${HOME}/tools/PyAPS/tests/test_calc.py

0 comments on commit 0f47a63

Please sign in to comment.