Skip to content

Commit

Permalink
Add basic CI
Browse files Browse the repository at this point in the history
  • Loading branch information
remileduc committed Nov 9, 2023
1 parent dfcfbd1 commit 5e8e9b7
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/actions/package-install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 📥 Install Package
description: Install Node.js, NPM, and the package's NPM dependencies, and cache it.

runs:
using: composite
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "latest"
cache: "npm"

- name: Output versions
shell: bash
run: |
echo Node and NPM versions
node --version
npm --version
- name: Install NPM dependencies
shell: bash
run: npm install
17 changes: 17 additions & 0 deletions .github/workflows/_build-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: ⚒️ Build - 🧹 Lint

on: workflow_call

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: 📥 Install
uses: ./.github/actions/package-install

- name: Build
run: npm run build

- name: Lint
run: npm run lint
14 changes: 14 additions & 0 deletions .github/workflows/_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 📙 Documentation

on: workflow_call

jobs:
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: 📥 Install
uses: ./.github/actions/package-install

- name: Biuld documentation
run: npm run doc
14 changes: 14 additions & 0 deletions .github/workflows/_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 📝 Tests

on: workflow_call

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: 📥 Install
uses: ./.github/actions/package-install

- name: Run tests
run: npm test
16 changes: 16 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: ⚙️ CI

on: push

jobs:
call-build-lint:
name: ⚒️ Build - 🧹 Lint
uses: ./.github/workflows/_build-lint.yaml

call-tests:
name: 📝 Tests
uses: ./.github/workflows/_tests.yaml

call-docs:
name: 📙 Documentation
uses: ./.github/workflows/_docs.yaml
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# config
.github/
.clang-format
.editorconfig
.eslintrc.json
Expand Down

0 comments on commit 5e8e9b7

Please sign in to comment.