Skip to content

Commit

Permalink
Merge pull request #12 from smoia/int/bots
Browse files Browse the repository at this point in the history
Add initial infrastructure
  • Loading branch information
Stefano Moia authored Nov 13, 2020
2 parents a86baef + eb438e5 commit 4a6b21a
Show file tree
Hide file tree
Showing 10 changed files with 327 additions and 94 deletions.
35 changes: 21 additions & 14 deletions .autorc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
"first-time-contributor",
"released"
],
"release": {
"prerelease": true
},
"owner": "physiopy",
"repo": "phys2bids",
"repo": "phys2denoise",
"name": "Stefano Moia",
"email": "[email protected]",
"labels": [
Expand All @@ -19,68 +16,78 @@
"changelogTitle": "💥 Breaking Change",
"description": "This PR breaks compatibility, and increments the major version (+1.0.0)",
"releaseType": "major",
"overwrite": true
"overwrite": true,
"color": "#05246d"
},
{
"name": "Minormod",
"changelogTitle": "🚀 Enhancement",
"description": "This PR generally closes an `Enhancement` issue. It increments the minor version (0.+1.0)",
"releaseType": "minor",
"overwrite": true
"overwrite": true,
"color": "#05246d"
},
{
"name": "Minormod-breaking",
"changelogTitle": "💥 Breaking Change during development",
"description": "For development only, this PR increments the minor version (0.+1.0) but breaks compatibility",
"releaseType": "minor",
"overwrite": true
"overwrite": true,
"color": "#05246d"
},
{
"name": "BugFIX",
"changelogTitle": "🐛 Bug Fix",
"description": "This PR generally closes a `Bug` issue, and increments the patch version (0.0.+1)",
"releaseType": "patch",
"overwrite": true
"overwrite": true,
"color": "#d73a4a"
},
{
"name": "Documentation",
"changelogTitle": "📝 Documentation",
"description": "This issue or PR is about the documentation ",
"releaseType": "none",
"overwrite": true
"overwrite": true,
"color": "#1D70CF"
},
{
"name": "Testing",
"changelogTitle": "⚠️ Tests",
"description": "This is for testing features, writing tests or producing testing code",
"releaseType": "none",
"overwrite": true
"overwrite": true,
"color": "#ffb5b4"
},
{
"name": "Internal",
"changelogTitle": "🏠 Internal",
"description": "Changes affect the internal API. It doesn't increase the version, but produces a changelog",
"releaseType": "none",
"overwrite": true
"overwrite": true,
"color": "#ffffff"
},
{
"name": "Outreach",
"changelogTitle": "🖋️ Outreach",
"description": "Issue about outreaching of any form",
"releaseType": "none",
"overwrite": true
"overwrite": true,
"color": "#0e8a16"
},
{
"name": "Skip release",
"description": "This PR preserves the current version when merged, and doesn't appear in the changelog",
"releaseType": "skip",
"overwrite": true
"overwrite": true,
"color": "#ffffff"
},
{
"name": "Release",
"description": "For PR only, trigger a release at the merge",
"releaseType": "release",
"overwrite": true
"overwrite": true,
"color": "#FFFFFF"
}
]
}
1 change: 1 addition & 0 deletions .circleci/artifact_path
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0/tmp/src/phys2denoise/docs/_build/html/index.html
216 changes: 216 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
# Python CircleCI 2.1 configuration file
#
#
#
version: 2.1
orbs:
codecov: codecov/[email protected]
jobs:

makeenv_37:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/phys2denoise
steps:
- checkout
- persist_to_workspace:
root: /tmp
paths:
- src/phys2denoise
- restore_cache:
key: conda-py37-v1-{{ checksum "setup.cfg" }}
- run:
name: Generate environment
command: |
if [[ -e /opt/conda/envs/py36_env ]]; then
echo "Restoring environment from cache"
source activate phys2denoise_py37
else
conda create -yq -n phys2denoise_py37 python=3.7
source activate phys2denoise_py37
pip install -e ".[test,doc]"
fi
- save_cache:
key: conda-py37-v1-{{ checksum "setup.cfg" }}
paths:
- /opt/conda/envs/phys2denoise_py37

unittest_36:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/phys2denoise
steps:
- checkout
- restore_cache:
key: conda-py36-v1-{{ checksum "setup.cfg" }}
- run:
name: Generate environment
command: |
apt-get install -yqq make
if [ ! -d /opt/conda/envs/phys2denoise_py36 ]; then
conda create -yq -n phys2denoise_py36 python=3.6
source activate phys2denoise_py36
pip install -e ".[test]"
fi
- run:
name: Running unit tests
command: |
source activate phys2denoise_py36
make unittest
mkdir /tmp/src/coverage
mv /tmp/src/phys2denoise/.coverage /tmp/src/coverage/.coverage.py36
- save_cache:
key: conda-py36-v1-{{ checksum "setup.cfg" }}
paths:
- /opt/conda/envs/phys2denoise_py36
- persist_to_workspace:
root: /tmp
paths:
- src/coverage/.coverage.py36

unittest_37:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/phys2denoise
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "setup.cfg" }}
- run:
name: Running unit tests
command: |
apt-get install -y make
source activate phys2denoise_py37 # depends on makeenv_37
make unittest
mkdir /tmp/src/coverage
mv /tmp/src/phys2denoise/.coverage /tmp/src/coverage/.coverage.py37
- persist_to_workspace:
root: /tmp
paths:
- src/coverage/.coverage.py37

integrationtest_36:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/phys2denoise
steps:
- checkout
- restore_cache:
key: conda-py36-v1-{{ checksum "setup.cfg" }}
- run:
name: Generate environment
command: |
apt-get install -yqq make
if [ ! -d /opt/conda/envs/phys2denoise_py36 ]; then
conda create -yq -n phys2denoise_py36 python=3.6
source activate phys2denoise_py36
pip install -e ".[test]"
fi
- run:
name: Run integration tests
no_output_timeout: 10m
command: |
source activate phys2denoise_py36
make integration
mkdir /tmp/src/coverage
mv /tmp/src/phys2denoise/.coverage /tmp/src/coverage/.coverage.integration36
- store_artifacts:
path: /tmp/data
- persist_to_workspace:
root: /tmp
paths:
- src/coverage/.coverage.integration36

integrationtest_37:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/phys2denoise
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "setup.cfg" }}
- run:
name: Run integration tests
no_output_timeout: 10m
command: |
apt-get install -yqq make
source activate phys2denoise_py37 # depends on makeenv_37
make integration
mkdir /tmp/src/coverage
mv /tmp/src/phys2denoise/.coverage /tmp/src/coverage/.coverage.integration37
- store_artifacts:
path: /tmp/data
- persist_to_workspace:
root: /tmp
paths:
- src/coverage/.coverage.integration37

style_check:
docker:
- image: continuumio/miniconda3
working_directory: /tmp/src/phys2denoise
steps:
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "setup.cfg" }}
- run:
name: Style check
command: |
apt-get install -yqq make
source activate phys2denoise_py37 # depends on makeenv37
make lint
- store_artifacts:
path: /tmp/data/lint

build_docs:
working_directory: /tmp/src/phys2denoise
docker:
- image: continuumio/miniconda3
steps:
- attach_workspace: # get phys2denoise
at: /tmp
- restore_cache: # load environment
key: conda-py37-v1-{{ checksum "setup.cfg" }}
- run:
name: Build documentation
command: |
apt-get install -yqq make
source activate phys2denoise_py37 # depends on makeenv_37
make -C docs html
- store_artifacts:
path: /tmp/src/phys2denoise/docs/_build/html

merge_coverage:
working_directory: /tmp/src/phys2denoise
docker:
- image: continuumio/miniconda3
steps:
- attach_workspace:
at: /tmp
- checkout
- restore_cache:
key: conda-py37-v1-{{ checksum "setup.cfg" }}
- run:
name: Merge coverage files
command: |
apt-get install -yqq curl
source activate phys2denoise_py37 # depends on makeenv37
cd /tmp/src/coverage/
coverage combine
coverage xml
- store_artifacts:
path: /tmp/src/coverage
- codecov/upload:
file: /tmp/src/coverage/coverage.xml

workflows:
version: 2.1
build_test:
jobs:
- makeenv_37
- style_check:
requires:
- makeenv_37
- merge_coverage:
requires:
- style_check
43 changes: 43 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflows will create a release using auto when a PR is merged in master.

name: Auto-release on PR merge

on:
# ATM, this is the closest trigger to a PR merging
push:
branches:
- master

jobs:
auto-release:
runs-on: ubuntu-18.04
# Set skip ci to avoid loops
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
# Set bash as default shell for jobs
defaults:
run:
shell: bash
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
# Fetch all history for all branches and tags
fetch-depth: 0
# Use token with write access to the repo
token: ${{ secrets.GH_TOKEN }}
- name: Download and install latest auto
env:
# OS can be linux, macos, or win
OS: linux
# Retrieve URL of latest auto, download it, unzip it, and give exec permissions.
run: |
curl -vkL -o - $( curl -s https://api.github.com/repos/intuit/auto/releases/latest \
| grep browser_download_url | grep ${OS} | awk -F'"' '{print $4}') \
| gunzip > ~/auto
chmod a+x ~/auto
- name: Create release without version prefix
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# Run auto release, don't use 'v' prefix, and be verbose
run: |
~/auto shipit --no-version-prefix -v
19 changes: 19 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- doc
system_packages: true
1 change: 1 addition & 0 deletions .requires.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 1.0
requirements:
- requirements.txt
- setup.cfg
- setup.py
- tox.ini
- path: /requirements.txt
Expand Down
Loading

0 comments on commit 4a6b21a

Please sign in to comment.