-
Notifications
You must be signed in to change notification settings - Fork 6
88 lines (73 loc) · 2.81 KB
/
goth.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Goth (PR and push)
on:
workflow_dispatch:
push:
branches:
- main
- b0.*
# - <your-branch> # put your branch name here to test it @ GH Actions
pull_request:
branches:
- main
- b0.*
jobs:
goth-tests:
name: Run integration tests
runs-on: [goth, ubuntu-22.04]
steps:
- name: install docker-compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.4/docker-compose-Linux-x86_64" -o /usr/local/bin/docker-compose
sudo chmod a+x /usr/local/bin/docker-compose
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Configure python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install and configure Poetry
run: python -m pip install -U pip setuptools poetry==1.3.2
- name: Install dependencies
run: |
poetry env use python3.8
poetry install -vvv
- name: Disconnect Docker containers from default network
continue-on-error: true
# related to this issue: https://github.com/moby/moby/issues/23302
run: |
docker network inspect docker_default
sudo apt-get install -y jq
docker network inspect docker_default | jq ".[0].Containers | map(.Name)[]" | tee /dev/stderr | xargs --max-args 1 -- docker network disconnect -f docker_default
- name: Remove Docker containers
continue-on-error: true
run: docker rm -f $(docker ps -a -q)
- name: Restart Docker daemon
# related to this issue: https://github.com/moby/moby/issues/23302
run: sudo systemctl restart docker
- name: Log in to GitHub Docker repository
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{github.actor}} --password-stdin
- name: Initialize the test suite
run: poetry run poe tests_integration_init
- name: Run test suite
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run poe tests_integration
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: goth-logs
path: /tmp/goth-tests/dapp-runner
# Only relevant for self-hosted runners
- name: Remove test logs
if: always()
run: rm -rf /tmp/goth-tests/dapp-runner
# Only relevant for self-hosted runners
- name: Remove poetry virtual env
if: always()
# Python version below should agree with the version set up by this job.
# In the future we'll be able to use the `--all` flag here to remove envs for
# all Python versions (https://github.com/python-poetry/poetry/issues/3208).
run: poetry env remove python3.8