Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
simonepri committed Jul 3, 2020
1 parent 0e35949 commit d5143b9
Show file tree
Hide file tree
Showing 13 changed files with 174 additions and 87 deletions.
25 changes: 0 additions & 25 deletions .appveyor.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .codecov.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: lint

on:
push:
branches: '*'
pull_request:
branches: '*'

jobs:
lint:
runs-on: ubuntu-latest
name: XO & Prettier
steps:
- name: Setup repo
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 4
- name: Install dev dependencies
run: |
npm install
npm list --dev --depth=0
- name: Run lint
run: npm run lint
35 changes: 35 additions & 0 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: test-macos

on:
push:
branches: '*'
pull_request:
branches: '*'

jobs:
test:
runs-on: macos-latest
name: AVA & Codecov
strategy:
fail-fast: false
matrix:
node: [14, 12, 10, 8, 6, 4]
steps:
- name: Setup repo
uses: actions/checkout@v2
- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install lib dependencies
run: |
npm install --production
npm list --prod --depth=0
- name: Install dev dependencies
run: |
npm install
npm list --dev --depth=0
- name: Run tests
run: npm run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
35 changes: 35 additions & 0 deletions .github/workflows/test-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: test-ubuntu

on:
push:
branches: '*'
pull_request:
branches: '*'

jobs:
test:
runs-on: ubuntu-latest
name: AVA & Codecov
strategy:
fail-fast: false
matrix:
node: [14, 12, 10, 8, 6, 4]
steps:
- name: Setup repo
uses: actions/checkout@v2
- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install lib dependencies
run: |
npm install --production
npm list --prod --depth=0
- name: Install dev dependencies
run: |
npm install
npm list --dev --depth=0
- name: Run tests
run: npm run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
35 changes: 35 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: test-windows

on:
push:
branches: '*'
pull_request:
branches: '*'

jobs:
test:
runs-on: windows-latest
name: AVA & Codecov
strategy:
fail-fast: false
matrix:
node: [14, 12, 10, 8, 6, 4]
steps:
- name: Setup repo
uses: actions/checkout@v2
- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install lib dependencies
run: |
npm install --production
npm list --prod --depth=0
- name: Install dev dependencies
run: |
npm install
npm list --dev --depth=0
- name: Run tests
run: npm run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,5 @@ function deserialize(phcstr) {

module.exports = {
serialize,
deserialize
deserialize,
};
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Simone Primarosa
Copyright (c) 2018-2020 Simone Primarosa

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
18 changes: 7 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,18 @@
"node": ">=4"
},
"scripts": {
"test": "xo &&nyc ava",
"release": "np",
"update": "npm-check -u"
},
"publishConfig": {
"access": "public"
"lint": "xo",
"test": "nyc ava",
"release": "npx np",
"update": "npx npm-check -u"
},
"dependencies": {
"safe-buffer": "^5.1.2"
},
"devDependencies": {
"ava": "*",
"np": "*",
"npm-check": "*",
"nyc": "*",
"xo": "*"
"ava": "~0.25.0",
"nyc": "^11.6.0",
"xo": "~0.20.3"
},
"ava": {
"verbose": true
Expand Down
49 changes: 32 additions & 17 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,40 @@
<b>phc-format</b>
</h1>
<p align="center">
<!-- CI - TravisCI -->
<a href="https://travis-ci.com/simonepri/phc-format">
<img src="https://img.shields.io/travis/com/simonepri/phc-format/master.svg?label=MacOS%20%26%20Linux" alt="Mac/Linux Build Status" />
<!-- Version - npm -->
<a href="https://www.npmjs.com/package/@phc/format">
<img src="https://img.shields.io/npm/v/@phc/format.svg" alt="Latest version on npm" />
</a>
<!-- Downloads - npm -->
<a href="https://npm-stat.com/charts.html?package=@phc/format">
<img src="https://img.shields.io/npm/dt/@phc/format.svg" alt="Downloads on npm" />
</a>
<!-- License - MIT -->
<a href="https://github.com/simonepri/phc-format/tree/master/license">
<img src="https://img.shields.io/github/license/simonepri/phc-format.svg" alt="Project license" />
</a>

<br/>

<!-- Lint -->
<a href="https://github.com/simonepri/phc-format/actions?query=workflow:lint+branch:master">
<img src="https://github.com/simonepri/phc-format/workflows/lint/badge.svg?branch=master" alt="Lint status" />
</a>
<!-- Test - macOS -->
<a href="https://github.com/simonepri/phc-format/actions?query=workflow:test-macos+branch:master">
<img src="https://github.com/simonepri/phc-format/workflows/test-macos/badge.svg?branch=master" alt="Test macOS status" />
</a>
<!-- Test - Ubuntu -->
<a href="https://github.com/simonepri/phc-format/actions?query=workflow:test-ubuntu+branch:master">
<img src="https://github.com/simonepri/phc-format/workflows/test-ubuntu/badge.svg?branch=master" alt="Test Ubuntu status" />
</a>
<!-- CI - AppVeyor -->
<a href="https://ci.appveyor.com/project/simonepri/phc-format">
<img src="https://img.shields.io/appveyor/ci/simonepri/phc-format/master.svg?label=Windows" alt="Windows Build status" />
<!-- Test - Windows -->
<a href="https://github.com/simonepri/phc-format/actions?query=workflow:test-windows+branch:master">
<img src="https://github.com/simonepri/phc-format/workflows/test-windows/badge.svg?branch=master" alt="Test Windows status" />
</a>

<br/>

<!-- Coverage - Codecov -->
<a href="https://codecov.io/gh/simonepri/phc-format">
<img src="https://img.shields.io/codecov/c/github/simonepri/phc-format/master.svg" alt="Codecov Coverage report" />
Expand Down Expand Up @@ -45,17 +71,6 @@
<a href="https://github.com/sindresorhus/np">
<img src="https://img.shields.io/badge/released_with-np-6c8784.svg" alt="NP Release System used" />
</a>

<br/>

<!-- Version - npm -->
<a href="https://www.npmjs.com/package/@phc/format">
<img src="https://img.shields.io/npm/v/@phc/format.svg" alt="Latest version on npm" />
</a>
<!-- License - MIT -->
<a href="https://github.com/simonepri/phc-format/tree/master/license">
<img src="https://img.shields.io/github/license/simonepri/phc-format.svg" alt="Project license" />
</a>
</p>
<p align="center">
📝 PHC string format serializer/deserializer
Expand Down
3 changes: 1 addition & 2 deletions test/deserialize.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import test from 'ava';

import sdData from './fixtures/serialize-deserialize';

import m from '..';
import sdData from './fixtures/serialize-deserialize';

test('should deserialize correct phc strings', t => {
sdData.serialized.forEach((g, i) => {
Expand Down
5 changes: 2 additions & 3 deletions test/serialize.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import test from 'ava';

import m from '..';
import sdData from './fixtures/serialize-deserialize';
import sData from './fixtures/serialize-only';

import m from '..';

test('should serialize correct phc objects', t => {
sdData.deserialized.forEach((g, i) => {
t.deepEqual(m.serialize(sdData.deserialized[i]), sdData.serialized[i]);
Expand Down Expand Up @@ -53,7 +52,7 @@ test('should thow errors if trying to serialize with invalid arguments', async t
id: 'pbkdf2',
params: {rounds: '1000'},
salt: Buffer.from('string'),
hash: 'string'
hash: 'string',
})
);
t.is(err.message, 'hash must be a Buffer');
Expand Down

0 comments on commit d5143b9

Please sign in to comment.