forked from ChainSafe/lodestar
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (71 loc) · 2.62 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Tests
on: [pull_request, push]
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, 18]
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>
# Cache validator slashing protection data tests
- name: Restore spec tests cache
uses: actions/cache@master
with:
path: packages/validator/spec-tests
key: spec-test-data-${{ hashFiles('packages/validator/test/spec/params.ts') }}
# Misc sanity checks
- name: Lint Grafana dashboards
run: node scripts/validate-grafana-dashboard.mjs ./dashboards
- 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: Check Types
run: yarn run check-types
# Test docs generation, even if not published
- name: Build docs
run: yarn build:docs
# TODO: uncomment after https://github.com/bbc/typescript-docs-verifier/issues/17 is resolved
# - name: README check
# run: yarn run check-readme
- name: Lint
run: yarn lint
- name: Check Build
run: yarn check-build
- name: Unit tests
run: yarn test:unit
- name: Upload coverage data
run: yarn coverage
- 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 }}