Skip to content

Commit

Permalink
Improve existing CI jobs
Browse files Browse the repository at this point in the history
We impreoved CI jobs by adding cache and using `npm ci` as we do across
our repos.
  • Loading branch information
nkuba committed Jan 5, 2021
1 parent 84d1354 commit 3b22bde
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "11.x"
node-version: "12.x"
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-solidity-node-modules
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
run: npm ci
- name: Run JS linter
run: npm run lint:js

Expand All @@ -23,8 +34,19 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "11.x"
node-version: "12.x"
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-solidity-node-modules
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
run: npm ci
- name: Run Solidity linter
run: npm run lint:sol
15 changes: 13 additions & 2 deletions .github/workflows/solidity-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "11.x"
node-version: "12.x"
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-solidity-node-modules
with:
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
run: npm ci
- name: Run tests
# Runs ganache in background
run: |
Expand Down

0 comments on commit 3b22bde

Please sign in to comment.