Skip to content

Commit

Permalink
ci(template): update project template from ahmadnassri/template-node-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Aug 7, 2020
1 parent aebf323 commit b9a9271
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 44 deletions.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ updates:
directory: /
schedule:
interval: daily

2 changes: 1 addition & 1 deletion .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
steps:
- uses: ahmadnassri/action-dependabot-auto-merge@v1
with:
github-token: ${{ secrets.GH_TOKEN }}
github-token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
16 changes: 5 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ on:
- master

jobs:
dependencies:
audit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]

# run checks
- run: npm audit --audit-level=moderate

test:
needs: dependencies
needs: audit

strategy:
matrix:
Expand All @@ -28,17 +26,15 @@ jobs:

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/.npm
key: client-${{ hashFiles('**/package-lock.json') }}
key: ${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}

- uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}

# run test
- run: npm ci
- run: npm run test

Expand All @@ -49,9 +45,7 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: semantic-release
uses: ahmadnassri/action-semantic-release@v1
- uses: ahmadnassri/action-semantic-release@v1
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- uses: docker://github/super-linter:v3
env:
VALIDATE_ALL_CODEBASE: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
10 changes: 3 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ on:
- master

jobs:
dependencies:
audit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]

# run checks
- run: npm audit --audit-level=moderate

test:
needs: dependencies
needs: audit

strategy:
matrix:
Expand All @@ -28,16 +26,14 @@ jobs:

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: ~/.npm
key: client-${{ hashFiles('**/package-lock.json') }}
key: ${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}

- uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}

# run test
- run: npm ci
- run: npm run test
8 changes: 8 additions & 0 deletions colophon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2.0

id: oas-request

about:
title: OpenAPI Spec HTTP Client
description: Feed it a JSON Spec, it will spit out a lightweight HTTP client!
repository: ahmadnassri/node-oas-request
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ services:
image: pandoc/core
volumes:
- ./:/data
command: docs/README.md --template docs/README.template --output README.md --from markdown_github+yaml_metadata_block --to gfm --fail-if-warnings
command: docs/README.md --metadata-file colophon.yml --template docs/README.template --output README.md --from markdown_github+yaml_metadata_block --to gfm --fail-if-warnings

test:
<<: *node
image: node:alpine
# command: npm run test:coverage
depends_on:
- node10
- node12
Expand Down
7 changes: 0 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
---
title: OpenAPI Spec HTTP Client
description: Feed it a JSON Spec, it will spit out a lightweight HTTP client!
repo: ahmadnassri/node-oas-request
package: oas-request
---

## Why

While there are plenty of _"code generators"_ for OpenAPI, they create a lot of "garbage" code that you may not need,
Expand Down
22 changes: 11 additions & 11 deletions docs/README.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $title$
# $about.title$

$description$
$about.description$

[![license][license-img]][license-url]
[![version][npm-img]][npm-url]
Expand All @@ -15,16 +15,16 @@ $body$
> Twitter: [@AhmadNassri](https://twitter.com/AhmadNassri)

[license-url]: LICENSE
[license-img]: https://badgen.net/github/license/$repo$
[license-img]: https://badgen.net/github/license/$about.repository$

[npm-url]: https://www.npmjs.com/package/$package$
[npm-img]: https://badgen.net/npm/v/$package$
[npm-url]: https://www.npmjs.com/package/$id$
[npm-img]: https://badgen.net/npm/v/$id$

[super-linter-url]: https://github.com/$repo$/actions?query=workflow%3Asuper-linter
[super-linter-img]: https://github.com/$repo$/workflows/super-linter/badge.svg
[super-linter-url]: https://github.com/$about.repository$/actions?query=workflow%3Asuper-linter
[super-linter-img]: https://github.com/$about.repository$/workflows/super-linter/badge.svg

[test-url]: https://github.com/$repo$/actions?query=workflow%3Atest
[test-img]: https://github.com/$repo$/workflows/test/badge.svg
[test-url]: https://github.com/$about.repository$/actions?query=workflow%3Atest
[test-img]: https://github.com/$about.repository$/workflows/test/badge.svg

[release-url]: https://github.com/$repo$/actions?query=workflow%3Arelease
[release-img]: https://github.com/$repo$/workflows/release/badge.svg
[release-url]: https://github.com/$about.repository$/actions?query=workflow%3Arelease
[release-img]: https://github.com/$about.repository$/workflows/release/badge.svg
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "0.0.0-semantically-released",
"name": "oas-request",
"description": "OAS 3.x dynamic request client",
"description": "Feed it a JSON Spec, it will spit out a lightweight HTTP client!",
"author": "Ahmad Nassri <[email protected]> (https://www.ahmadnassri.com)",
"homepage": "https://github.com/ahmadnassri/node-oas-request",
"repository": {
Expand Down Expand Up @@ -30,6 +30,5 @@
"devDependencies": {
"sinon": "^9.0.2",
"tap": "^14.10.8"
},
"dependencies": {}
}
}

0 comments on commit b9a9271

Please sign in to comment.