Skip to content

Commit

Permalink
Merge b7d4840 into b6c1e2b
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Aug 2, 2022
2 parents b6c1e2b + b7d4840 commit 4d3be50
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 16 deletions.
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 }}

0 comments on commit 4d3be50

Please sign in to comment.