Nightly Cypress Tests #130
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 Cypress Tests | |
on: | |
schedule: | |
- cron: "20 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: | |
cypress-tests: | |
runs-on: goth2 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use random string for subnet | |
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 4 | |
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 && ./node_modules/.bin/cypress install" | |
- name: Run web server | |
run: docker exec -t -d docker-requestor-1 /bin/sh -c "cd /golem-js/examples/web && node app.mjs" | |
- name: Run test suite | |
run: docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm run test:cypress -- --browser chromium" | |
- name: Upload test logs | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
name: cypress-logs | |
path: .cypress | |
- name: Cleanup Docker | |
if: always() | |
run: | | |
c=$(docker ps -q) | |
[[ $c ]] && docker kill $c | |
docker system prune -af |