Skip to content

Commit

Permalink
chore: cleanup nodejs.yaml (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
odanado authored Feb 26, 2022
1 parent c600b9e commit 8462fbd
Showing 1 changed file with 24 additions and 70 deletions.
94 changes: 24 additions & 70 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,26 @@ on:
push:
branches:
- master
pull_request_target:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

jobs:
setup:
test-unit:
runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
matrix:
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v2
if: (github.event_name == 'pull_request_target')
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/checkout@v2
if: (github.event_name != 'pull_request_target')
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
key: node-v${{ matrix.node-version }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
cache: yarn

- name: yarn install
run: |
Expand All @@ -50,49 +33,16 @@ jobs:
run: |
yarn build
test-unit:
needs: [setup]
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v2
if: (github.event_name == 'pull_request_target')
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/checkout@v2
if: (github.event_name != 'pull_request_target')
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
key: node-v${{ matrix.node-version }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}

- name: run unit test
run: |
yarn test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

test-e2e:
needs: [setup]
runs-on: ubuntu-latest

strategy:
Expand All @@ -101,28 +51,16 @@ jobs:

steps:
- uses: actions/checkout@v2
if: (github.event_name == 'pull_request_target')
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/checkout@v2
if: (github.event_name != 'pull_request_target')
with:
fetch-depth: 0

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v2
with:
path: |
node_modules
packages/*/node_modules
key: node-v${{ matrix.node-version }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
- name: yarn install
run: |
yarn install --frozen-lockfile
- name: run yarn build
run: |
Expand All @@ -141,6 +79,22 @@ jobs:
RPC_URL: ${{ steps.geth.outputs.rpc_url }}
PRIVATE_KEY: ${{ steps.geth.outputs.private_key }}

check-esm-import:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Check ESM Import
run: |
yarn install
Expand Down

0 comments on commit 8462fbd

Please sign in to comment.