Skip to content

Commit

Permalink
chore: add missing deps, remove redundant deps (#344)
Browse files Browse the repository at this point in the history
Also update gh actions to cache build
  • Loading branch information
achingbrain authored Sep 15, 2021
1 parent 9e5e03d commit f91018c
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 98 deletions.
88 changes: 0 additions & 88 deletions .github/workflows/main.yml

This file was deleted.

179 changes: 179 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- run: |
npm install
npm run build
npx lerna link
check:
name: Check
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build
- run: |
npm run lint
npm run dep-check -- -- -- -p
npm run dep-check -- -- -- -- --unused
test-node:
needs: build
runs-on: ${{ matrix.os }}
name: Unit test ${{ matrix.project }} node ${{ matrix.node }} ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node: [16]
project:
- ipfs-repo
- ipfs-repo-migrations
steps:
- uses: actions/checkout@v2
with:
fetch-depth: ${{ github.event.pull_request.commits }}
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build
- run: npm run test -- --since ${{ github.event.pull_request.base.sha }} --scope=${{ matrix.project }} -- -- --cov -t node

test-browser:
needs: build
runs-on: ubuntu-latest
name: Unit test ${{ matrix.project }} ${{ matrix.browser }} ${{ matrix.type }}
strategy:
matrix:
project:
- ipfs-repo
# - ipfs-repo-migrations
browser:
- chromium
- firefox
type:
- browser
- webworker
steps:
- uses: actions/checkout@v2
with:
fetch-depth: ${{ github.event.pull_request.commits }}
- uses: actions/setup-node@v1
with:
node-version: 16
- uses: actions/cache@v2
id: cache
env:
CACHE_NAME: cache-node-modules
with:
path: |
~/.npm
./node_modules
./packages/*/node_modules
./packages/*/dist
key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install
npm run build
- run: npm run test -- --since ${{ github.event.pull_request.base.sha }} --scope=${{ matrix.project }} -- -- -t ${{ matrix.type }} -- --browser ${{ matrix.browser }}

# test-electron:
# needs: build
# runs-on: ubuntu-latest
# name: test ${{ matrix.project }} ${{ matrix.type }}
# strategy:
# matrix:
# project:
# - ipfs-repo
# - ipfs-repo-migrations
# type:
# - electron-main
# - electron-renderer
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: ${{ github.event.pull_request.commits }}
# - uses: actions/setup-node@v1
# with:
# node-version: 16
# - uses: actions/cache@v2
# id: cache
# env:
# CACHE_NAME: cache-node-modules
# with:
# path: |
# ~/.npm
# ./node_modules
# ./packages/*/node_modules
# ./packages/*/dist
# key: ${{ runner.os }}-build-${{ env.CACHE_NAME }}-${{ github.event.pull_request.head.sha }}
# - name: Install Dependencies
# if: steps.cache.outputs.cache-hit != 'true'
# run: |
# npm install
# npm run build
# - run: npm install
# - run: npm run build
# - uses: GabrielBB/xvfb-action@v1
# with:
# run: npm run test -- --since ${{ github.event.pull_request.base.sha }} --scope=${{ matrix.project }} -- -- -t ${{ matrix.type }} --bail
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "lerna run build",
"clean": "lerna run clean",
"lint": "lerna run lint",
"depcheck": "lerna run depcheck",
"dep-check": "lerna run dep-check",
"release": "npm run update-contributors && lerna run build && lerna publish",
"release:rc": "lerna run build && lerna publish --canary --preid rc --dist-tag next",
"update-contributors": "aegir release --lint=false --test=false --bump=false --build=false --changelog=false --commit=false --tag=false --push=false --ghrelease=false --docs=false --publish=false"
Expand Down
5 changes: 1 addition & 4 deletions packages/ipfs-repo-migrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"release": "aegir release",
"release-minor": "aegir release --type minor",
"release-major": "aegir release --type major",
"depcheck": "aegir dep-check"
"dep-check": "aegir dep-check -i interface-blockstore -i assert -i events -i npm-run-all -i util"
},
"dependencies": {
"@ipld/dag-pb": "^2.0.0",
Expand All @@ -60,7 +60,6 @@
"interface-datastore": "^6.0.2",
"it-length": "^1.0.1",
"multiformats": "^9.0.0",
"proper-lockfile": "^4.1.1",
"protobufjs": "^6.10.2",
"uint8arrays": "^3.0.0",
"varint": "^6.0.0"
Expand All @@ -79,11 +78,9 @@
"datastore-level": "^7.0.1",
"datastore-s3": "^8.0.0",
"events": "^3.2.0",
"it-all": "^1.0.2",
"just-safe-set": "^2.1.0",
"level-5": "npm:level@^5.0.0",
"level-6": "npm:level@^6.0.0",
"ncp": "^2.0.0",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.0",
"sinon": "^11.1.1",
Expand Down
8 changes: 3 additions & 5 deletions packages/ipfs-repo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"release-major": "aegir release --type major --target node",
"pretest": "aegir build --esm-tests",
"test": "aegir test",
"dep-check": "aegir dep-check -i rimraf"
"dep-check": "aegir dep-check -i rimraf -i interface-blockstore -i assert -i events -i npm-run-all -i util"
},
"repository": {
"type": "git",
Expand All @@ -97,12 +97,9 @@
"events": "^3.3.0",
"ipfs-utils": "^8.1.3",
"it-all": "^1.0.2",
"it-drain": "^1.0.1",
"it-first": "^1.0.2",
"just-range": "^2.1.0",
"rimraf": "^3.0.0",
"sinon": "^11.1.1",
"url": "^0.11.0",
"util": "^0.12.3"
},
"dependencies": {
Expand All @@ -112,11 +109,12 @@
"datastore-core": "^6.0.7",
"debug": "^4.1.0",
"err-code": "^3.0.1",
"eslint-plugin-ava": "^12.0.0",
"interface-blockstore": "^2.0.2",
"interface-datastore": "^6.0.2",
"ipfs-repo-migrations": "^11.0.0",
"it-drain": "^1.0.1",
"it-filter": "^1.0.2",
"it-first": "^1.0.2",
"it-map": "^1.0.5",
"it-merge": "^1.0.2",
"it-parallel-batch": "^1.0.9",
Expand Down

0 comments on commit f91018c

Please sign in to comment.