Nightly E2E Tests #941
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: | |
# run this workflow every day at 1:00 AM UTC | |
- cron: "0 1 * * *" | |
# 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: [goth2, ubuntu-22.10] | |
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: 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 | |
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 | |
- 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: 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 test suite | |
env: | |
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
npm run test:e2e | |
- 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 | |
- name: Cleanup Docker | |
if: always() | |
run: | | |
c=$(docker ps -q) && [[ $c ]] && docker kill $c | |
docker system prune -af |