Scx1332/fix e2e test #3132
Workflow file for this run
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: Goth integration tests (hybrid-net) | |
on: | |
workflow_dispatch: | |
inputs: | |
workflow_number: | |
description: 'Id of workflow binaries-x86-64 to get binaries from' | |
required: true | |
push: | |
branches: | |
- master | |
- release/* | |
- '**/all-tests' | |
- '**/integration-tests' | |
pull_request: | |
branches: | |
- master | |
- release/* | |
jobs: | |
test_check: | |
name: Check test results | |
runs-on: ubuntu-latest | |
steps: | |
- name: Wait for build to succeed ( ubuntu ) | |
if: github.event_name != 'workflow_dispatch' | |
uses: tomchv/wait-my-workflow@v1.1.0 | |
id: wait-for-build-ubu | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
checkName: "Build binaries (x86-64)" | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
intervalSeconds: 30 | |
timeoutSeconds: 3600 | |
- name: Fail if build was not a success ( ubuntu ) | |
if: github.event_name != 'workflow_dispatch' | |
run: echo job status= ${{ steps.wait-for-build-ubu.outputs.conclusion }} && ${{ fromJSON('["false", "true"]')[steps.wait-for-build-ubu.outputs.conclusion == 'success'] }} | |
integration-test-groups: | |
name: Integration Tests (hybrid-net) group | |
runs-on: [goth2] | |
needs: test_check | |
strategy: | |
fail-fast: false | |
matrix: | |
group: [1, 2] | |
defaults: | |
run: | |
working-directory: "./goth_tests" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
- name: Configure Python | |
continue-on-error: true | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
ln -sf $HOME/.local/bin/poetry /usr/bin/poetry | |
- name: Install dependencies | |
run: | | |
poetry install --no-root | |
- name: Cleanup Docker | |
if: always() | |
run: | | |
c=$(docker ps -q) && [[ $c ]] && docker kill $c | |
docker system prune -af | |
- name: Log in to GitHub Docker repository | |
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{github.actor}} --password-stdin | |
- name: Download artifact | |
if: github.event_name != 'workflow_dispatch' | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: binaries-x86-64.yml | |
commit: ${{github.event.pull_request.head.sha || github.sha}} | |
workflow_conclusion: success | |
name: "Yagna Linux" | |
path: /tmp/yagna-build | |
- name: Download artifact from given run id | |
if: github.event_name == 'workflow_dispatch' | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
run_id: ${{github.event.inputs.workflow_number}} | |
workflow_conclusion: success | |
name: "Yagna Linux" | |
path: /tmp/yagna-build | |
- name: Run test suite | |
env: | |
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
poetry run poe goth-tests --splits 2 --group ${{ matrix.group }} --config-override docker-compose.build-environment.binary-path=/tmp/yagna-build | |
- 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 | |
# 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 --all | |
- name: Cleanup Docker | |
if: always() | |
run: | | |
c=$(docker ps -q) && [[ $c ]] && docker kill $c | |
docker system prune -af | |
integration-test: | |
name: Integration Tests (hybrid-net) | |
runs-on: ubuntu-latest | |
needs: [integration-test-groups] | |
steps: | |
- name: Check status | |
if: needs.integration-test-groups.result != 'success' | |
run: exit 1 |