-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Actions workflow for integration tests
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Integration tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
integration-test: | ||
name: Run integration tests | ||
runs-on: goth | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Configure poetry | ||
uses: Gr1N/setup-poetry@v4 | ||
with: | ||
poetry-version: 1.1.4 | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- 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: Run unit tests | ||
env: | ||
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: poetry run poe integration_test |