File tree Expand file tree Collapse file tree 2 files changed +41
-23
lines changed
Expand file tree Collapse file tree 2 files changed +41
-23
lines changed Original file line number Diff line number Diff line change 1- name : Run linters
1+ name : Node.js CI
22
33on : [push]
44
@@ -101,3 +101,43 @@ jobs:
101101
102102 - name : Run Solidity linter
103103 run : npm run lint:sol
104+
105+ run-tests :
106+ needs : install
107+ runs-on : ubuntu-latest
108+ steps :
109+ - uses : actions/checkout@v2
110+ - uses : actions/setup-node@v2
111+ with :
112+ node-version : " 12.x"
113+
114+ # # Restore `node_nodules` from cache initialized in `install` job.
115+ # Get exact Node version.
116+ - name : Get Node version
117+ id : node-version
118+ run : echo "::set-output name=version::$(node --version)"
119+ # Restore cache for specific OS, Node version and `package-lock.json` files hash.
120+ # It is expected that the cache will always be found as it was initialized
121+ # in `install` job executed as a requirement of this job.
122+ - name : Restore cached node modules
123+ id : node-cache
124+ uses : actions/cache@v2
125+ env :
126+ cache-name : node-modules
127+ with :
128+ path : node_modules
129+ key : ${{ runner.os }}-${{ env.cache-name }}-${{ steps.node-version.outputs.version }}-${{ hashFiles('**/package-lock.json') }}
130+ # As a fallback to not found cached node_modules directory execute `npm ci`
131+ # to install dependencies. It's not expected to happen, but better be safe
132+ # than sorry.
133+ - name : Install dependencies
134+ if : steps.node-cache.outputs.cache-hit != 'true'
135+ run : npm ci
136+
137+ - name : Run tests
138+ # Runs ganache in background
139+ run : |
140+ npm run buidler-vm &
141+ npm test
142+ env :
143+ CI : true
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments