Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pfigel committed Mar 3, 2020
1 parent 2790202 commit 39a2f86
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 0 deletions.
132 changes: 132 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
version: 2.1
commands:
install_civicrm:
description: "Install CiviCRM"
parameters:
build_name:
type: string
default: master
type:
type: string
default: drupal-clean
version:
type: string
default: master
url:
type: string
default: http://localhost:8080
steps:
- run: |
civiver=<< parameters.version >>
if [[ "$civiver" == "stable" ]]; then
civiver=$(curl -s 'https://latest.civicrm.org/stable.php')
fi
su - buildkit -c "/buildkit/bin/civibuild create << parameters.build_name >> --civi-ver $civiver --type << parameters.type >> --url << parameters.url >>"
install_extension:
description: "Install Extension"
parameters:
build_name:
type: string
default: master
steps:
- run: |
EXT_DIR=/buildkit/build/<< parameters.build_name >>/web/sites/default/files/civicrm/ext/$CIRCLE_PROJECT_REPONAME
cp /root/project $EXT_DIR -r
chown buildkit:buildkit $EXT_DIR -R
cd $EXT_DIR
su - buildkit -c "cd /buildkit/build/<< parameters.build_name >>/web && cv en $CIRCLE_PROJECT_REPONAME"
run_civilint:
description: "Run civilint"
parameters:
build_name:
type: string
default: master
steps:
- run: su - buildkit -c "cd /buildkit/build/<< parameters.build_name >>/web/sites/default/files/civicrm/ext/$CIRCLE_PROJECT_REPONAME && find . -type f -not -path './vendor/*' | civilint -"
run_phpunit:
description: "Run PHPUnit"
parameters:
build_name:
type: string
default: master
steps:
- run: |
mkdir -p /phpunit /coverage
chown buildkit:buildkit /phpunit /coverage
su - buildkit -c "cd /buildkit/build/<< parameters.build_name >>/web/sites/default/files/civicrm/ext/$CIRCLE_PROJECT_REPONAME && phpdbg -qrr /buildkit/bin/phpunit5 --log-junit /phpunit/<< parameters.build_name >>/junit.xml --coverage-html /coverage/<< parameters.build_name >>"
run_all:
description: "Run all steps"
parameters:
build_name:
type: string
default: master
type:
type: string
default: drupal-clean
version:
type: string
default: master
url:
type: string
default: http://localhost:8080
steps:
- install_civicrm:
build_name: << parameters.build_name >>
type: << parameters.type >>
version: << parameters.version >>
url: << parameters.url >>
- install_extension:
build_name: << parameters.build_name >>
# TODO: enable civilint
# - run_civilint:
# build_name: << parameters.build_name >>
- run_phpunit:
build_name: << parameters.build_name >>
- store_test_results:
path: /phpunit
- store_artifacts:
path: /phpunit
- store_artifacts:
path: /coverage

executors:
civicrm:
docker:
- image: michaelmcandrew/civicrm-buildkit
name: civicrm
environment:
TERM: xterm-color
APACHE_RUN_USER: buildkit
- image: mysql:5.7
name: mysql
environment:
MYSQL_ROOT_PASSWORD: buildkit
- image: djfarrelly/maildev
name: maildev

jobs:
build:
executor: civicrm
steps:
- checkout
- run_all
- run_all:
build_name: civi-stable
version: "stable"
url: http://localhost:8081

workflows:
version: 2
build:
jobs:
- build
nightly:
triggers:
- schedule:
cron: "0 5 * * *"
filters:
branches:
only:
- master
jobs:
- build
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# webshoptools

[![CircleCI](https://circleci.com/gh/greenpeace-cee/webshoptools.svg?style=svg)](https://circleci.com/gh/greenpeace-cee/webshoptools)

This CiviCRM extension provides some behind-the-scenes tooling for an activity-based webshop process.

The extension is licensed under [AGPL-3.0](LICENSE.txt).
Expand Down

0 comments on commit 39a2f86

Please sign in to comment.