Skip to content

Commit

Permalink
build: update build config (#74)
Browse files Browse the repository at this point in the history
* build: add codecov to build workflow

* build(config): use dependabot only for github actions

* build(config): enable renovate bot

* build(config): let release drafter determine version

* build: update publish workflow to newest state

* build: add standard workflow

* build(deps-dev): add codecov dev dependency

* build(deps-dev): add codecov config to package.json

* build(config): add semantic commit config
  • Loading branch information
matfax authored Aug 23, 2020
1 parent 2299b5c commit 5006a85
Show file tree
Hide file tree
Showing 11 changed files with 1,172 additions and 264 deletions.
12 changes: 0 additions & 12 deletions .dependabot/config.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 4
20 changes: 18 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: '$NEXT_PATCH_VERSION'
name-template: 'v$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
Expand All @@ -14,6 +14,22 @@ categories:
labels:
- 'chore'
- 'dependencies'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'feature'
- 'enhancement'
patch:
labels:
- 'fix'
- 'bugfix'
- 'bug'
- 'chore'
- 'dependencies'
default: patch
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
template: |
## What’s Changed
Expand Down
25 changes: 25 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"extends": [
"config:base",
":semanticCommitType(chore)"
],
"separateMinorPatch": true,
"patch": {
"automerge": true
},
"pin": {
"automerge": true
},
"lockFileMaintenance": {
"automerge": true
},
"vulnerabilityAlerts": {
"labels": [
"security"
]
},
"labels": [
"dependencies",
"chore"
]
}
3 changes: 3 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
titleOnly: true
allowMergeCommits: true
allowRevertCommits: true
64 changes: 40 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,50 @@
name: build

on: [push]
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]
os: [ubuntu-latest]
defaults:
run:
shell: bash
name: node.js ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v1
- name: setup node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: caching node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}-${{ matrix.node-version }}
restore-keys: |
${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
${{ runner.OS }}-build
- name: installing dependencies
if: steps.cache-primes.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
env:
CI: true
- name: running tests
run: yarn test
env:
CI: true
- uses: actions/[email protected]
- name: setup node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: caching node modules
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ matrix.node-version }}
${{ runner.OS }}-build
- name: installing dependencies
if: steps.cache-primes.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
env:
CI: true
- name: running tests
run: yarn test
env:
CI: true
- name: running coverage
run: yarn coverage
env:
CI: true
- name: uploading coverage to codecov
run: $(yarn bin)/codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
101 changes: 78 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,73 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [10.x, 12.x, 13.x, 14.x]
os: [ubuntu-latest]
defaults:
run:
shell: bash
name: node.js ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v1
- name: setup node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: installing dependencies
run: yarn install --frozen-lockfile
env:
CI: true
- name: running tests
run: yarn test
env:
CI: true
- uses: actions/[email protected]
- name: setup node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: caching node modules
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ matrix.node-version }}
${{ runner.OS }}-build
- name: installing dependencies
if: steps.cache-primes.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
env:
CI: true
- name: running tests
run: yarn test
env:
CI: true
- name: running coverage
run: yarn coverage
env:
CI: true
- name: uploading coverage to codecov
run: $(yarn bin)/codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

publish-npm:
name: publish on npm
needs: build
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [14.x]
os: [ubuntu-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/[email protected]
- name: setup node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: 14
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- name: caching node modules
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ matrix.node-version }}
${{ runner.OS }}-build
- name: installing dependencies
run: yarn install --frozen-lockfile
env:
Expand All @@ -47,23 +85,40 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-gpr:
name: publish on GitHub
needs: build
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [14.x]
os: [ubuntu-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/[email protected]
- name: setup node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: 14
node-version: ${{ matrix.node-version }}
registry-url: https://npm.pkg.github.com
scope: '@gofunky'
- name: caching node modules
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ matrix.node-version }}
${{ runner.OS }}-build
- name: installing dependencies
run: yarn install --frozen-lockfile
env:
CI: true
- name: publish
# workaround until https://github.com/actions/setup-node/issues/67 is solved
run: |
$(yarn bin)/json -I -f package.json -e "this.name=\"@gofunky/cssauron-noeval\""
$(yarn bin)/json -I -f package.json -e "this.name=\"@${{ github.repository }}\""
$(yarn bin)/npm-deploy-git-tag
env:
CI: true
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: check standard

on:
push:
branches: [ master ]

jobs:
standard:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x]
os: [ubuntu-latest]
name: check standard style
defaults:
run:
shell: bash
steps:
- uses: actions/[email protected]
- name: setup node.js ${{ matrix.node-version }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.node-version }}
- name: caching node modules
uses: actions/[email protected]
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ matrix.node-version }}
${{ runner.OS }}-build
- name: installing standard
run: npm install standard --global
- name: running standard
run: standard --fix
- name: creating pull request
id: cpr
uses: peter-evans/[email protected]
with:
commit-message: 'style(format): reformat with standard'
title: 'Deploy standard code style'
body: |
This pull requests deploys the standard code style [standard][1].
[1]: https://standardjs.com/
labels: |
style
chore
standard
branch: standard
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"test": "test"
},
"scripts": {
"test": "node test/index.js"
"test": "node test/index.js",
"coverage": "nyc --reporter=lcov tape test/*.js | tap-nyc",
"report": "nyc report --reporter=html"
},
"repository": {
"type": "git",
Expand All @@ -19,7 +21,7 @@
"match"
],
"author": {
"name": "Matthias Fax",
"name": "matfax",
"email": "[email protected]",
"url": "https://github.com/gofunky/cssauron-noeval"
},
Expand All @@ -29,6 +31,7 @@
},
"devDependencies": {
"@hutson/npm-deploy-git-tag": "^6.0.0",
"codecov": "^3.7.2",
"eslint": "^7.7.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.0",
Expand All @@ -37,10 +40,12 @@
"eslint-plugin-standard": "^4.0.0",
"json": "^9.0.6",
"standard": "^14.3.4",
"tape": "^5.0.1"
"tape": "^4.13.3",
"nyc": "15.1.0",
"tap-nyc": "1.0.3"
},
"engine": {
"node": ">=10.13.0"
"node": ">= 10.13.0 <15"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 0 additions & 5 deletions renovate.json

This file was deleted.

Loading

0 comments on commit 5006a85

Please sign in to comment.