diff --git a/.github/workflows/test-browser.yml b/.github/workflows/test-browser.yml new file mode 100644 index 000000000000..49d44570cc79 --- /dev/null +++ b/.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: + # - 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' + # + + # 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 diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml new file mode 100644 index 000000000000..0a3b63291fb4 --- /dev/null +++ b/.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: + # - 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' + # + + # 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 }} diff --git a/.github/workflows/test-sim-merge.yml b/.github/workflows/test-sim-merge.yml index f1d2024c55ff..9d190f3a62db 100644 --- a/.github/workflows/test-sim-merge.yml +++ b/.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 diff --git a/.github/workflows/test-sim.yml b/.github/workflows/test-sim.yml index 0a26ee4f8522..b70b56daf819 100644 --- a/.github/workflows/test-sim.yml +++ b/.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: diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index fc4cf2f56163..bee72eb87d8e 100644 --- a/.github/workflows/test-spec.yml +++ b/.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: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 853595d17109..b48fe9bf1783 100644 --- a/.github/workflows/test.yml +++ b/.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: @@ -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 }}