Skip to content

Nightly Cypress Tests #82

Nightly Cypress Tests

Nightly Cypress Tests #82

name: Nightly Cypress Tests
on:
schedule:
# run this workflow every day at 1:20 AM UTC
- cron: "20 1 * * *"
# Allows triggering the workflow manually
workflow_dispatch:
jobs:
cypress-tests:
runs-on: [goth2, ubuntu-22.10]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install browsers and graphic environment
run: |
sudo apt-get update -y
sudo apt-get install -y build-essential
sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install --allow-downgrades -y ./google-chrome-stable_current_amd64.deb
- name: Build the SDK
run: |
npm install
npm run build
- name: Configure python
continue-on-error: true
uses: actions/setup-python@v4
with:
python-version: "3.10"
- 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 -Ezi 's/(use\-prerelease:\s)(false)/\1true\n release-tag: "0.13.0-rc10"/mg' ../goth/assets/goth-config.yml
sed -i '/^ENTRYPOINT/i ENV YAGNA_AUTOCONF_APPKEY=try_golem' ../goth/assets/docker/yagna-goth-deb.Dockerfile
- 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: Run web server
run: |
cd examples/web
node app.mjs &
- name: Run test suite
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run test:cypress -- --browser chrome
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-logs
path: .cypress
# Only relevant for self-hosted runners
- name: Remove test logs
if: always()
run: rm -rf .cypress
- name: Cleanup Docker
if: always()
run: |
c=$(docker ps -q) && [[ $c ]] && docker kill $c
docker system prune -af