Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
310 lines (296 sloc) 8.09 KB
version: 2
# trigger cache invalidation: 2018-09-16T22:39+00:00
variables:
restore_cache: &restore_cache
restore_cache:
keys:
- miniconda-{{ checksum ".circleci/common.sh" }}-{{ checksum ".circleci/setup.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}
save_cache: &save_cache
save_cache:
key: miniconda-{{ checksum ".circleci/common.sh" }}-{{ checksum ".circleci/setup.sh" }}-{{ checksum ".circleci/config.yml" }}-{{ arch }}
paths:
- miniconda
common: &common
run:
name: Download common definitions
command: |
curl -s https://raw.githubusercontent.com/bioconda/bioconda-common/master/common.sh > .circleci/common.sh
setup: &setup
run:
name: Setup bioconda-utils
command: .circleci/setup.sh
macos: &macos
macos:
xcode: "8.3.3"
environment:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
linux: &linux
machine: true
skip_fork: &skip_fork
run:
name: Check for fork
command: |
[[ $CIRCLE_PROJECT_USERNAME == bioconda ]] || (
echo "Skipping build for fork '$CIRCLE_PROJECT_USERNAME'"
circleci step halt
)
fail_fork: &fail_fork
run:
name: Check for fork
command: |
[[ $CIRCLE_PROJECT_USERNAME == bioconda ]] || (
echo "Aborting build for fork '$CIRCLE_PROJECT_USERNAME'"
echo "Please use a branch other than 'master' or 'bulk' on your fork"
exit 1
)
jobs:
# When running CircleCI locally, we put everything in one job.
build:
docker:
- image: bioconda/bioconda-utils-build-env
steps:
- checkout
- run:
name: Setup ssh
command: |
mkdir -p ~/.ssh
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- run: echo ". /opt/conda/etc/profile.d/conda.sh" >> $BASH_ENV
- run: echo "conda activate" >> $BASH_ENV
- *common
- *setup
- run:
name: Linting
command: |
bioconda-utils lint recipes config.yml \
--loglevel debug --full-report \
--git-range master HEAD
- run:
name: Testing
# Currently, using --docker below causes a permission error on Fedora 27,
# although it should be supported by the setup_remote_docker directive
# above. A workaround or an upstream fix would be welcome.
command: |
bioconda-utils build recipes config.yml \
--git-range master HEAD
lint:
<<: *linux
steps:
- checkout
- *common
- *restore_cache
- *setup
- *save_cache
- run:
name: Linting
command: |
bioconda-utils lint recipes config.yml \
--loglevel debug --full-report \
--git-range master HEAD
# build and test on linux
test-linux:
<<: *linux
steps:
- checkout
- *common
- *restore_cache
- *setup
- *save_cache
- run:
name: Building and testing
command: |
bioconda-utils build recipes config.yml \
--docker --mulled-test \
--git-range master HEAD
# build and test on macos
test-macos:
<<: *macos
steps:
- checkout
- *common
- *restore_cache
- *setup
- *save_cache
- run:
name: Building and testing
command: |
bioconda-utils build recipes config.yml \
--git-range master HEAD
# build, test and upload on linux
upload-linux:
<<: *linux
steps:
- *fail_fork
- checkout
- *common
- *restore_cache
- *setup
- *save_cache
# build only current commit (since we use squashed merging, this is safe)
- run:
name: Building, testing, and uploading
command: |
bioconda-utils build recipes config.yml \
--docker --mulled-test --anaconda-upload --mulled-upload-target biocontainers \
--git-range $CIRCLE_SHA1~1 $CIRCLE_SHA1 \
--prelint
# build, test and upload on macos
upload-macos:
<<: *macos
steps:
- *fail_fork
- checkout
- *common
- *restore_cache
- *setup
- *save_cache
# build only current commit (since we use squashed merging, this is safe)
- run:
name: Building, testing and uploading
command: |
bioconda-utils build recipes config.yml \
--anaconda-upload \
--git-range $CIRCLE_SHA1~1 $CIRCLE_SHA1 \
--prelint
# build, test and upload for bulk branch on linux
bulk-linux:
<<: *linux
steps:
- *fail_fork
- checkout
- *common
- *restore_cache
- *setup
- *save_cache
- run:
name: Building, testing, and uploading of all unpublished recipes
command: |
bioconda-utils build recipes config.yml \
--docker --mulled-test --anaconda-upload --mulled-upload-target biocontainers
# build, test and upload for bulk branch on macos
bulk-macos:
<<: *macos
steps:
- *fail_fork
- checkout
- *common
- *restore_cache
- *setup
- *save_cache
- run:
name: Building, testing and uploading of all unpublished recipes
command: |
bioconda-utils build recipes config.yml \
--anaconda-upload
# nightly build, test and upload of unpublished recipes on linux
nightly-upload-linux:
<<: *linux
steps:
- *skip_fork
- checkout
- *common
- *restore_cache
- *setup
- *save_cache
- run:
name: Building, testing, and uploading of all unpublished recipes
command: |
bioconda-utils build recipes config.yml \
--docker --mulled-test --anaconda-upload --mulled-upload-target biocontainers \
--prelint
# nightly build, test and upload of unpublished recipes on macos
nightly-upload-macos:
<<: *macos
steps:
- *skip_fork
- checkout
- *common
- *restore_cache
- *setup
- *save_cache
- run:
name: Building, testing and uploading of all unpublished recipes
command: |
bioconda-utils build recipes config.yml \
--anaconda-upload \
--prelint
workflows:
version: 2
# workflow for testing pushes and PRs
bioconda-test:
jobs:
# Linting is now also performed just before a recipe is built with
# bioconda-utils build --prelint.
- lint:
filters:
branches:
ignore:
- master
- bulk
- test-linux:
requires:
- lint
filters:
branches:
ignore:
- master
- bulk
- test-macos:
requires:
- lint
- test-linux
filters:
branches:
ignore:
- master
- bulk
# workflow for uploading packages from master and bulk branch
bioconda-upload-master:
jobs:
- upload-linux:
filters:
branches:
only:
- master
- upload-macos:
filters:
branches:
only:
- master
# workflow for bulk-updates
bioconda-upload-bulk-linux:
jobs:
- bulk-linux:
filters:
branches:
only:
- bulk
bioconda-upload-bulk-macos:
jobs:
- bulk-macos:
filters:
branches:
only:
- bulk
# nightly workflow to capture missed recipes
bioconda-nightly-upload-linux:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- nightly-upload-linux
bioconda-nightly-upload-macos:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- nightly-upload-macos