Nightly E2E Tests #1016
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: Nightly E2E Tests | |
on: | |
schedule: | |
- cron: "0 1 * * *" | |
workflow_dispatch: | |
inputs: | |
provider_version: | |
description: "Provider version (e.g., v0.12.3 or pre-rel-v0.13.1)" | |
required: false | |
default: "v0.12.3" | |
requestor_version: | |
description: "Requestor version (e.g., v0.12.3 or pre-rel-v0.13.1)" | |
required: false | |
default: "v0.12.3" | |
provider_wasi_version: | |
description: "Provider WASI version (e.g., v0.2.2)" | |
required: false | |
default: "v0.2.2" | |
provider_vm_version: | |
description: "Provider VM version (e.g., v0.3.0)" | |
required: false | |
default: "v0.3.0" | |
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: goth2 | |
needs: prepare-matrix-master-only | |
strategy: | |
matrix: ${{ fromJson(needs.prepare-matrix-master-only.outputs.matrix-json) }} | |
fail-fast: false | |
name: Run integration tests (nightly) on ${{ matrix.branch }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use random string for subnet | |
# Use a random string to avoid other providers on the same subnet which might cause tests to fail because it expects only providers named provider-1 and provider-2 | |
run: echo "YAGNA_SUBNET=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo '')" >> $GITHUB_ENV | |
- name: Set up Versions | |
run: | | |
echo "PROVIDER_VERSION=${{ github.event.inputs.provider_version }}" >> $GITHUB_ENV | |
echo "REQUESTOR_VERSION=${{ github.event.inputs.requestor_version }}" >> $GITHUB_ENV | |
echo "PROVIDER_WASI_VERSION=${{ github.event.inputs.provider_wasi_version }}" >> $GITHUB_ENV | |
echo "PROVIDER_VM_VERSION=${{ github.event.inputs.provider_vm_version }}" >> $GITHUB_ENV | |
- name: Build the docker containers | |
run: | | |
docker compose -f tests/docker/docker-compose.yml build \ | |
--build-arg UBUNTU_VERSION=22.04 \ | |
--build-arg YA_CORE_PROVIDER_VERSION=${PROVIDER_VERSION} \ | |
--build-arg YA_CORE_REQUESTOR_VERSION=${REQUESTOR_VERSION} \ | |
--build-arg YA_WASI_VERSION=${PROVIDER_WASI_VERSION} \ | |
--build-arg YA_VM_VERSION=${PROVIDER_VM_VERSION} | |
- name: Start the docker containers | |
run: | | |
sudo service docker restart | |
docker compose -f tests/docker/docker-compose.yml down | |
docker compose -f tests/docker/docker-compose.yml up -d | |
- name: Fund the requestor | |
run: | | |
sleep 10 | |
docker exec -t docker-requestor-1 /bin/sh -c "/golem-js/tests/docker/fundRequestor.sh" | |
- name: Install and build the SDK | |
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build" | |
- name: Start the e2e test | |
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run test:e2e" | |
- name: Cleanup Docker | |
if: always() | |
run: | | |
c=$(docker ps -q) | |
[[ $c ]] && docker kill $c | |
docker system prune -af |