Skip to content

E2E ScoutCloud

E2E ScoutCloud #33

name: E2E ScoutCloud
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
schedule:
- cron: '*/180 * * * *'
workflow_dispatch:
inputs:
rpc_url:
description: 'RPC URL'
required: true
default: 'https://sepolia.drpc.org'
type: string
server_size:
description: 'Server size'
required: true
default: 'small'
type: string
chain_type:
description: 'Chain type'
required: true
default: 'ethereum'
type: string
node_type:
description: 'Node type'
required: true
default: 'geth'
type: string
workflow_call:
inputs:
rpc_url:
description: 'RPC URL'
required: true
default: 'https://sepolia.drpc.org'
type: string
server_size:
description: 'Server size'
required: true
default: 'small'
type: string
chain_type:
description: 'Chain type'
required: true
default: 'ethereum'
type: string
node_type:
description: 'Node type'
required: true
default: 'geth'
type: string
env:
SCOUTCLOUD_URL: ${{ secrets.SCOUTCLOUD_URL }}
SCOUTCLOUD_TOKEN: ${{ secrets.SCOUTCLOUD_TOKEN }}
SCOUTCLOUD_RPC_URL: ${{ inputs.rpc_url }}
SCOUTCLOUD_SERVER_SIZE: ${{ inputs.server_size }}
SCOUTCLOUD_CHAIN_TYPE: ${{ inputs.chain_type }}
SCOUTCLOUD_NODE_TYPE: ${{ inputs.node_type }}
PWDEBUG: 0
LOAD_AUTH_CTX: 0
LOAD_CONTRACTS_DATA: 0
ACCOUNT: 1
PROD: 1
jobs:
e2e_tests:
name: Tests
permissions:
id-token: write
contents: read
runs-on: ubuntu-20.04
environment:
name: Tests
steps:
- name: checkout
uses: actions/checkout@v2
with:
repository: blockscout/blockscout-ci-cd
path: blockscout-ci-cd
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: v14.17.0
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install deps
working-directory: blockscout-ci-cd/tests/e2e
run: npm ci
- name: Build contracts
working-directory: blockscout-ci-cd/tests/contracts
run: |
# gyp build from root
npm config set user 0
npm ci
npm run build
- name: Cache playwright binaries
uses: actions/cache@v2
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-build-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}
- name: Set environment variables
run: |
echo "SCOUTCLOUD_RPC_URL=${{ inputs.rpc_url || 'https://sepolia.drpc.org' }}" >> $GITHUB_ENV
echo "SCOUTCLOUD_SERVER_SIZE=${{ inputs.server_size || 'small' }}" >> $GITHUB_ENV
echo "SCOUTCLOUD_CHAIN_TYPE=${{ inputs.chain_type || 'ethereum' }}" >> $GITHUB_ENV
echo "SCOUTCLOUD_NODE_TYPE=${{ inputs.node_type || 'geth' }}" >> $GITHUB_ENV
- name: Deploy and test ScoutCloud instance UI
working-directory: blockscout-ci-cd/tests/e2e
run: |
npx playwright install
npm run test:scoutcloud
- uses: actions/upload-artifact@v3
if: always()
with:
name: tests-results
path: blockscout-ci-cd/tests/e2e/test-results
- uses: actions/upload-artifact@v3
if: always()
with:
name: state
path: blockscout-ci-cd/tests/e2e/state.json
defaults:
run:
shell: bash