Skip to content

DBG

DBG #76

Workflow file for this run

name: Bash tests
on:
push:
branches:
- feature/add-testing-base
pull_request:
branches:
- feature/add-testing-base
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Prepare dind testing and run tests
run: |
echo "Get image to run the tests."
docker pull metadrop/dind-for-drupal-boilerplate:v0.1
echo " Create a docker container fromt he downloaded image."
cid=$(docker run -d -it --privileged --name testrunner --mount type=bind,source=.,target=/tests metadrop/dind-for-drupal-boilerplate:v0.1)
echo "Make docker available for the tester user (dirty trick? anyway to improve it?)"
echo docker exec -it $cid chown :tester /var/run/docker.sock
exit -1
echo "Download and uncompress shellspec, the test framework used for testing."
docker exec -it $cid wget https://github.com/shellspec/shellspec/releases/download/0.28.1/shellspec-dist.tar.gz -O /opt/shellspec-dist.tar.gz
docker exec -it $cid tar xfvz /opt/shellspec-dist.tar.gz -C /opt/
# Prepare environment: run composer install
docker exec -it -u tester -w /tests/ $cid composer install --ignore-platform-reqs
# Run boierplate assistant
docker exec -u tester -w /tests/ $cid composer boilerplate:assistant
# Run tests!
docker exec -it -u tester -w /tests/ $cid /opt/shellspec/shellspec