Skip to content

test(examples): goth ci debug #2

test(examples): goth ci debug

test(examples): goth ci debug #2

Workflow file for this run

name: Nightly Examples Tests
on:
push:
branches:
- "test/JST-363/example-tests"
# Allows triggering the workflow manually
workflow_dispatch:
jobs:
prepare-matrix-master-only:
name: Prepare matrix JSON
runs-on: ubuntu-latest
outputs:
matrix-json: ${{ steps.get-matrix.outputs.matrix }}
steps:
# prepares JSON object representing strategy matrix with only the master branch
- name: Get matrix JSON
id: get-matrix
run: echo "::set-output name=matrix::{\"include\":[{\"branch\":\"master\"}]}"
goth-tests:
runs-on: goth
needs: prepare-matrix-master-only
strategy:
matrix: ${{ fromJson(needs.prepare-matrix-master-only.outputs.matrix-json) }}
fail-fast: false
name: Run example tests (nightly) on ${{ matrix.branch }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Build golem-js
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential
npm install
npm run build
- name: Configure python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install goth
run: |
pip install goth
rm -rf ../goth/assets
python -m goth create-assets ../goth/assets
sed -Ezi 's/(use\-proxy:\s)(True)/\1False/mg' ../goth/assets/goth-config.yml
sed -i '/^ router:/a \ \ \ \ \ \ \ \ environment:\n \ \ \ \ \ \ \ \ \ \ - YAGNA_AUTOCONF_APPKEY=try_golem' ../goth/assets/docker/docker-compose.yml
- name: Install websocat and sshpass
run: |
sudo wget https://github.com/vi/websocat/releases/download/v1.9.0/websocat_linux64 -O /usr/local/bin/websocat
sudo chmod +x /usr/local/bin/websocat
sudo apt-get install sshpass
- 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 test suite
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python -m goth start ../goth/assets/goth-config.yml
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: goth-logs
path: /tmp/goth-tests
# Only relevant for self-hosted runners
- name: Remove test logs
if: always()
run: rm -rf /tmp/goth-tests