Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate E2E and Browser github workflow tests #4356

Merged
merged 4 commits into from Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/test-browser.yml
@@ -0,0 +1,58 @@
name: Browser tests

on:
push:
branches:
- stable
- unstable
pull_request:
branches:
- stable
- unstable

jobs:
tests-main:
name: Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [16]
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{matrix.node}}
- name: Node.js version
id: node
run: echo "::set-output name=v8CppApiVersion::$(node --print "process.versions.modules")"
- name: Restore dependencies
uses: actions/cache@master
id: cache-deps
with:
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}-${{ steps.node.outputs.v8CppApiVersion }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
- name: Install & build
if: steps.cache-deps.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-optional && yarn build
- name: Build
run: yarn build
if: steps.cache-deps.outputs.cache-hit == 'true'
# </common-build>

# Misc sanity checks
- name: Test root binary exists
run: ./lodestar --version
- name: Reject yarn.lock changes
run: .github/workflows/scripts/reject_yarn_lock_changes.sh
# Run only on forks
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}

- name: Browser tests
run: |
export DISPLAY=':99.0'
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
yarn test:browsers
60 changes: 60 additions & 0 deletions .github/workflows/test-e2e.yml
@@ -0,0 +1,60 @@
name: E2E tests

on:
push:
branches:
- stable
- unstable
pull_request:
branches:
- stable
- unstable

env:
GOERLI_RPC_DEFAULT_URL: https://goerli.infura.io/v3/84842078b09946638c03157f83405213

jobs:
tests-main:
name: Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [16]
steps:
# <common-build> - Uses YAML anchors in the future
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{matrix.node}}
- name: Node.js version
id: node
run: echo "::set-output name=v8CppApiVersion::$(node --print "process.versions.modules")"
- name: Restore dependencies
uses: actions/cache@master
id: cache-deps
with:
path: |
node_modules
packages/*/node_modules
key: ${{ runner.os }}-${{ steps.node.outputs.v8CppApiVersion }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
- name: Install & build
if: steps.cache-deps.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-optional && yarn build
- name: Build
run: yarn build
if: steps.cache-deps.outputs.cache-hit == 'true'
# </common-build>

# Misc sanity checks
- name: Test root binary exists
run: ./lodestar --version
- name: Reject yarn.lock changes
run: .github/workflows/scripts/reject_yarn_lock_changes.sh
# Run only on forks
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}

- name: E2E tests
run: yarn test:e2e
env:
GOERLI_RPC_URL: ${{ secrets.GOERLI_RPC_URL!=0 && secrets.GOERLI_RPC_URL || env.GOERLI_RPC_DEFAULT_URL }}
10 changes: 9 additions & 1 deletion .github/workflows/test-sim-merge.yml
@@ -1,6 +1,14 @@
name: Sim merge tests

on: [pull_request, push]
on:
push:
branches:
- stable
- unstable
pull_request:
branches:
- stable
- unstable

env:
GETH_COMMIT: be9742721f56eb8bb7ebf4f6a03fb01b13a05408
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test-sim.yml
@@ -1,6 +1,14 @@
name: Sim tests

on: [pull_request, push]
on:
push:
branches:
- stable
- unstable
pull_request:
branches:
- stable
- unstable

jobs:
tests-sim:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test-spec.yml
@@ -1,6 +1,14 @@
name: Spec tests

on: [pull_request, push]
on:
push:
branches:
- stable
- unstable
pull_request:
branches:
- stable
- unstable

jobs:
tests-spec:
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/test.yml
@@ -1,9 +1,14 @@
name: Tests

on: [pull_request, push]

env:
GOERLI_RPC_DEFAULT_URL: https://goerli.infura.io/v3/84842078b09946638c03157f83405213
on:
push:
branches:
- stable
- unstable
pull_request:
branches:
- stable
- unstable

jobs:
tests-main:
Expand Down Expand Up @@ -72,12 +77,3 @@ jobs:
run: yarn test:unit
- name: Upload coverage data
run: yarn coverage
- name: Browser tests
run: |
export DISPLAY=':99.0'
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
yarn test:browsers
- name: E2E tests
run: yarn test:e2e
env:
GOERLI_RPC_URL: ${{ secrets.GOERLI_RPC_URL!=0 && secrets.GOERLI_RPC_URL || env.GOERLI_RPC_DEFAULT_URL }}