-
Notifications
You must be signed in to change notification settings - Fork 23
43 lines (32 loc) · 1.49 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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