Skip to content

frontend: add swap ui prototype #638

frontend: add swap ui prototype

frontend: add swap ui prototype #638

Workflow file for this run

name: Playwright Tests
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
jobs:
compute-version:
name: Compute firmware container version
runs-on: ubuntu-latest
outputs:
firmware_version: ${{ steps.get_version.outputs.firmware_version }}
steps:
- name: Checkout firmware repo
uses: actions/checkout@v4
with:
repository: BitBoxSwiss/bitbox02-firmware
path: bitbox02-firmware
- name: Read .containerversion
id: get_version
run: |
version=$(cat bitbox02-firmware/.containerversion)
echo "Firmware version: $version"
echo "firmware_version=$version" >> $GITHUB_OUTPUT
build-simulator:
name: Build simulator in container
runs-on: ubuntu-latest
needs: compute-version
container:
image: shiftcrypto/firmware_v2:${{ needs.compute-version.outputs.firmware_version }}
steps:
- name: Checkout firmware repo
uses: actions/checkout@v4
with:
repository: BitBoxSwiss/bitbox02-firmware
submodules: true
path: bitbox02-firmware
- name: Fetch tags
working-directory: bitbox02-firmware
run: git fetch --tags
- name: Build simulator
working-directory: bitbox02-firmware
run: make simulator
- name: Upload simulator binary
uses: actions/upload-artifact@v4
with:
name: simulator-binary
path: bitbox02-firmware/build-build-noasan/bin/simulator
run-tests:
runs-on: ubuntu-latest
needs: build-simulator
steps:
- uses: actions/checkout@v3
- name: Download simulator artifact
uses: actions/download-artifact@v4
with:
name: simulator-binary
path: ./simulator-bin
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: |
cd frontends/web
npm install
- name: Install Playwright browsers
run: |
cd frontends/web
npx playwright install --with-deps chromium webkit
- name: Restore executable permission
run: chmod +x simulator-bin/simulator
- name: Run Playwright tests
env:
SIMULATOR_PATH: ${{ github.workspace }}/simulator-bin/simulator
run: make webe2etest
- name: Upload Playwright artifacts and logs.
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-artifacts-and-logs
path: frontends/web/test-results/*