Skip to content

Commit

Permalink
chore: configure CI
Browse files Browse the repository at this point in the history
  • Loading branch information
justintaddei committed Jul 7, 2021
1 parent 9183a19 commit 05c61bf
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2
updates:
# Fetch and update latest `npm` packages
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- justintaddei
assignees:
- justintaddei
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- justintaddei
assignees:
- justintaddei
commit-message:
prefix: fix
prefix-development: chore
include: scope
36 changes: 36 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Conventional Commits

on: [push]

jobs:
commitlint:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@master
with:
fetch-depth: 0

- name: Setup node env πŸ—
uses: actions/setup-node@v2.1.4
with:
node-version: ${{ matrix.node }}

- name: Cache node_modules πŸ“¦
uses: actions/cache@v2.1.4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies ☁
run: npm ci

- name: Lint commit messages πŸ‘€
run: npx commitlint --from=HEAD~1
67 changes: 67 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: checks

on: [push, pull_request]

jobs:
tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@master
with:
fetch-depth: 0

- name: Setup node env πŸ—
uses: actions/setup-node@v2.1.4
with:
node-version: ${{ matrix.node }}

- name: Cache node_modules πŸ“¦
uses: actions/cache@v2.1.4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies ☁
run: npm ci

- name: Run tests πŸ§ͺ
run: npm test
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [14]

steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@master
with:
fetch-depth: 0

- name: Setup node env πŸ—
uses: actions/setup-node@v2.1.4
with:
node-version: ${{ matrix.node }}

- name: Cache node_modules πŸ“¦
uses: actions/cache@v2.1.4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies ☁
run: npm ci

- name: Build module bundles πŸ—
run: npm run build
17 changes: 17 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-length': [0],
'body-max-line-length': [0]
},
ignores: [
(commit) => {
// WIP: commits
return /^WIP(:\s(.|\n)+)?$/.test(commit.trim())
},
(commit) => {
// $ npm version commits (1.1.0)
return /^\d+\.\d+\.\d+.*$/.test(commit.trim())
}
]
}

0 comments on commit 05c61bf

Please sign in to comment.