DBG #77
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "Container ID is $cid" | |
echo "Make docker available for the tester user (dirty trick? anyway to improve it?)" | |
docker exec -it $cid chown :tester /var/run/docker.sock || echo "chown failed" | |
docker exec -it $cid ls -la /var/run/ | |
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 |