Skip to content

Commit

Permalink
chore: update testing, sync with latest patterns
Browse files Browse the repository at this point in the history
* update polendina w/ webpack 5 and better esm support
* make package.json and semantic-release config more consistent with js-multiformats
  • Loading branch information
rvagg committed Dec 10, 2021
1 parent fcb21c6 commit 3e0ccf7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 45 deletions.
37 changes: 10 additions & 27 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,32 @@ jobs:
fail-fast: false
matrix:
node: [14.x, 16.x]
os: [macos-latest, ubuntu-latest]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2.5.0
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: |
npm install --no-progress --no-package-lock
npm install --no-progress
- name: Run tests
run: |
npm test
test-windows:
strategy:
fail-fast: false
matrix:
node: [14.x, 16.x]
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2.3.4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v2.5.0
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: |
npm install --no-progress --no-package-lock
- name: Run tests
run: |
npm run test:node
npm config set script-shell bash
npm run test:ci
- name: Typecheck
uses: gozala/typescript-error-reporter-action@v1.0.8
release:
name: Release
needs: [test, test-windows]
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0
with:
fetch-depth: 0
- name: Setup Node.js
Expand All @@ -75,6 +58,6 @@ jobs:
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

48 changes: 31 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@
"main": "blake2.js",
"type": "module",
"scripts": {
"lint": "standard",
"build": "npm run build:source && npm run build:js && npm run build:types",
"build:js": "ipjs build --tests --main && npm run build:copy",
"build:source": "node build.js",
"build:copy": "cp -a tsconfig.json *.js test dist/",
"build:types": "tsc --build && mv types dist",
"publish": "ipjs publish",
"lint": "standard",
"test:cjs": "npm run build && mocha dist/cjs/node-test/test-*.js && npm run test:cjs:browser",
"test:esm": "npm run build && mocha dist/esm/node-test/test-*.js && npm run test:esm:browser",
"test:node": "c8 --check-coverage --branches 100 --functions 100 --lines 100 mocha test/test-*.js",
"test:cjs:browser": "polendina --cleanup dist/cjs/browser-test/test-*.js",
"test": "npm run build:source && npm run lint && npm run test:node && npm run test:cjs",
"test:node-v12": "npm run build:source && mocha test/test-*.js && npm run test:cjs",
"test:cjs:browser": "polendina --page --worker --serviceworker --cleanup dist/cjs/browser-test/test-*.js",
"test:esm:browser": "polendina --page --worker --serviceworker --cleanup dist/esm/browser-test/test-*.js",
"test": "npm run build:source && npm run lint && npm run test:node && npm run test:esm",
"test:ci": "npm run build:source && npm run lint && npm run test:node && npm run test:esm && npm run test:cjs",
"coverage": "c8 --reporter=html mocha test/test-*.js && npm_config_yes=true npx st -d coverage -p 8080"
},
"keywords": [
"IPFS",
"IPLD",
"ipfs",
"ipld",
"multiformats",
"hash",
"multihash",
Expand All @@ -40,23 +41,36 @@
"import": "./blake2s.js"
}
},
"devDependencies": {
"@ipld/dag-cbor": "^6.0.6",
"c8": "^7.7.3",
"ipjs": "^5.0.3",
"mocha": "^9.0.3",
"polendina": "^1.1.0",
"standard": "^16.0.3",
"typescript": "^4.3.5"
},
"dependencies": {
"blakejs": "^1.1.1",
"multiformats": "^9.4.3"
"multiformats": "^9.5.4"
},
"devDependencies": {
"@ipld/dag-cbor": "^6.0.15",
"c8": "^7.10.0",
"chai": "^4.3.4",
"ipjs": "^5.2.0",
"mocha": "^9.1.3",
"polendina": "^2.0.1",
"standard": "^16.0.4",
"typescript": "^4.5.3"
},
"standard": {
"ignore": [
"dist"
]
},
"directories": {
"test": "test"
},
"repository": {
"type": "git",
"url": "git+https://github.com/multiformats/js-blake2.git"
},
"bugs": {
"url": "https://github.com/multiformats/js-blake2/issues"
},
"homepage": "https://github.com/multiformats/js-blake2#readme",
"typesVersions": {
"*": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion test/test-basics.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as blake2b from '@multiformats/blake2/blake2b'
import * as blake2s from '@multiformats/blake2/blake2s'
import blake2 from '@multiformats/blake2'
import assert from 'assert'
import { assert } from 'chai'
import { bytes } from 'multiformats'
import table from './table.csv.js'

Expand Down

0 comments on commit 3e0ccf7

Please sign in to comment.