chore(test): setup docker and github actions #55
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: Run tests | |
on: [push, pull_request] | |
env: | |
IMAGE_TAG: world-token | |
jobs: | |
test: | |
name: Docker build and test | |
runs-on: ubuntu-latest | |
services: | |
ganache: | |
image: david9595/ganache-image:v1 | |
options: --name ganache | |
ports: | |
- 8545:8545 | |
steps: | |
- name: Check running containers | |
run: docker network create backend || true | |
- name: Connect to Ganache | |
run: docker network connect backend ganache | |
- name: Check running containers | |
run: docker ps -a | |
- name: Check container networks | |
run: docker network ls | |
- name: Check out the repository | |
uses: actions/checkout@v2 | |
- name: Build the Docker image | |
run: docker build -t $IMAGE_TAG --target=truffle . | |
- name: Run tests in Docker container | |
run: docker run --rm --network=backend $IMAGE_TAG sh -c 'truffle test --network pipeline' |