2024-10-11 11:32:03 +02:00
|
|
|
name: Playwright Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-10-11 11:33:06 +02:00
|
|
|
branches: [main, master, feat/tests/test-init]
|
|
|
|
tags: [releases*]
|
2024-10-11 11:32:03 +02:00
|
|
|
pull_request:
|
|
|
|
branches: [main, master]
|
2024-10-11 11:33:06 +02:00
|
|
|
tags: [releases*]
|
2024-10-11 11:32:03 +02:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
env:
|
|
|
|
codex_version: v0.1.6
|
2024-10-11 12:00:36 +02:00
|
|
|
circuit_version: v0.1.6
|
2024-10-11 11:32:03 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
timeout-minutes: 60
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Run Codex node
|
|
|
|
run: |
|
|
|
|
# Download
|
|
|
|
version=${{ env.codex_version }}
|
|
|
|
platform=$(echo `uname -s` | awk '{print tolower($0)}')
|
|
|
|
architecture=$([[ `uname -m` == 'x86_64' ]] && echo amd64 || echo arm64)
|
|
|
|
curl -LO https://github.com/codex-storage/nim-codex/releases/download/${version}/codex-${version}-${platform}-${architecture}.tar.gz
|
|
|
|
curl -LO https://github.com/codex-storage/nim-codex/releases/download/${version}/codex-${version}-${platform}-${architecture}.tar.gz.sha256
|
|
|
|
sha256sum -c codex-${version}-${platform}-${architecture}.tar.gz.sha256
|
|
|
|
[[ $? -eq 0 ]] && { echo "Checksum is OK"; } || { echo "Checksum failed"; exit 1; }
|
|
|
|
tar -zxvf codex-${version}-${platform}-${architecture}.tar.gz
|
|
|
|
sudo apt update && sudo apt install libgomp1
|
|
|
|
|
2024-10-11 12:00:36 +02:00
|
|
|
# Create circuit files folder
|
|
|
|
mkdir -p datadir/circuits
|
|
|
|
chmod 700 datadir/circuits
|
|
|
|
|
|
|
|
# Download circuit files
|
|
|
|
curl -OL https://github.com/codex-storage/nim-codex/releases/download/${circuit_version}/cirdl-${circuit_version}-${platform}-${architecture}.tar.gz
|
|
|
|
tar -xvf cirdl-${circuit_version}-${platform}-${architecture}.tar.gz
|
2024-10-11 12:01:35 +02:00
|
|
|
./cirdl-${circuit_version}-${platform}-${architecture} \
|
2024-10-11 12:00:36 +02:00
|
|
|
datadir/circuits \
|
|
|
|
https://rpc.testnet.codex.storage \
|
|
|
|
0xfE822Df439d987849a90B64a4C0e26a297DBD47F
|
|
|
|
|
|
|
|
# Get an eth address
|
2024-10-11 11:32:03 +02:00
|
|
|
response=$(curl -s https://key.codex.storage)
|
|
|
|
awk -F ': ' '/private/ {print $2}' <<<"${response}" > eth.key
|
|
|
|
awk -F ': ' '/address/ {print $2}' <<<"${response}" > eth.address
|
|
|
|
chmod 600 eth.key
|
|
|
|
ETH_ADDRESS=$(cat eth.address)
|
|
|
|
|
|
|
|
# Run
|
2024-10-11 12:00:36 +02:00
|
|
|
./codex-${version}-${platform}-${architecture} --data-dir=datadir --api-cors-origin="*" persistence --eth-provider=https://rpc.testnet.codex.storage --eth-private-key=./eth.key --marketplace-address=0xfE822Df439d987849a90B64a4C0e26a297DBD47F prover --circuit-dir=/datadir/circuits &
|
2024-10-11 11:32:03 +02:00
|
|
|
|
|
|
|
- name: Check Codex API
|
|
|
|
run: |
|
|
|
|
curl --max-time 5 --fail localhost:8080/api/codex/v1/debug/info -w "\n"
|
|
|
|
[[ $? -eq 0 ]] && { echo "Codex node is up"; } || { echo "Please check Codex node"; exit 1; }
|
|
|
|
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: lts/*
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
if: false
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: Install Playwright Browsers
|
|
|
|
if: false
|
|
|
|
run: npx playwright install --with-deps
|
|
|
|
|
|
|
|
- name: Run Playwright tests
|
|
|
|
if: false
|
|
|
|
run: npx playwright test
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
if: false
|
|
|
|
# if: ${{ !cancelled() }}
|
|
|
|
with:
|
|
|
|
name: playwright-report
|
|
|
|
path: playwright-report/
|
|
|
|
retention-days: 30
|