PR: v2 bounty payouts #396
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: Cypress Frontend E2E tests | |
on: | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
cypress-run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Enable docker.host.internal for Ubuntu | |
run: | | |
pwd && sudo bash -c 'echo "172.17.0.1 host.docker.internal" >> /etc/hosts' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Build Tribes Image | |
run: pwd && ls && docker build -t sphinxlightning/sphinx-tribes:latest . | |
- name: Clone Stack | |
run: | | |
git clone https://github.com/stakwork/sphinx-stack.git stackv1 | |
- name: Clone Sphinx Tribes Frontend | |
run: | | |
git clone https://github.com/stakwork/sphinx-tribes-frontend.git tribes-frontend | |
- name: Give Permissions to Stack | |
working-directory: ./stackv1 | |
run: | | |
chmod 777 ./bitcoind; | |
chmod 777 -R ./relay; | |
chmod 777 -R ./lnd; | |
chmod 777 -R ./proxy; | |
chmod 777 -R ./cln; | |
- name: Check for NODES | |
uses: nick-fields/retry@v2 | |
with: | |
timeout_minutes: 10 | |
max_attempts: 3 | |
command: | | |
GITACTION_ENV=gitactionenv docker compose -f ./stackv1/alts/proxy.yml --project-directory ./stackv1 up -d; | |
sleep 240; | |
docker ps | |
docker logs meme.sphinx | |
docker logs dave.sphinx | |
docker logs tribes.sphinx | |
docker wait stackv1-relaysetup-1 | |
cat stackv1/relay/NODES.json; | |
- name: Copy Node.json | |
uses: canastro/copy-file-action@master | |
with: | |
source: "stackv1/relay/NODES.json" | |
target: "tribes-frontend/cypress/fixtures/nodes.json" | |
- name: Install Frontend Dependencies | |
working-directory: ./tribes-frontend | |
run: yarn install | |
- name: Start Server | |
working-directory: ./tribes-frontend | |
run: yarn run start:cypress & | |
- name: Run Cypress Test | |
working-directory: ./tribes-frontend | |
run: | | |
sleep 20 | |
yarn run cypress:run | |
- name: Upload Cypress logs | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: cypress-logs | |
path: tribes-frontend/cypress/screenshots | |
- name: Stop Stack | |
working-directory: ./stackv1 | |
run: docker compose down |