Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
beeauvin committed May 1, 2023
0 parents commit bd44898
Show file tree
Hide file tree
Showing 19 changed files with 4,839 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@sunbeams"]
}
25 changes: 25 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

name: install
description: install node and dependencies

inputs:
node-version:
description: node version to install
required: false
default: '18'

runs:
using: 'composite'
steps:
- name: install node
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: 'npm'

- name: install dependencies
shell: bash
run: npm ci
23 changes: 23 additions & 0 deletions .github/workflows/_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

name: ci

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
uses: ./.github/workflows/check.yml
test:
uses: ./.github/workflows/test.yml
build:
uses: ./.github/workflows/build.yml
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

name: houseplant / build

on:
workflow_call:
inputs:
node-version:
description: node version to install
required: false
type: string
node-environment:
description: node environment to use
required: false
type: string

jobs:
build:
name: 🏗️
uses: ./.github/workflows/run.yml
with:
command: build
node-version: ${{ inputs.node-version }}
node-environment: ${{ inputs.node-environment }}
34 changes: 34 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

name: houseplant / check

on:
workflow_call:
inputs:
node-version:
description: node version to install
required: false
type: string
node-environment:
description: node environment to use
required: false
type: string

jobs:
format:
name: ☑️
uses: ./.github/workflows/run.yml
with:
command: check:format
node-version: ${{ inputs.node-version }}
node-environment: ${{ inputs.node-environment }}

lint:
name: ☑️
uses: ./.github/workflows/run.yml
with:
command: check:lint
node-version: ${{ inputs.node-version }}
node-environment: ${{ inputs.node-environment }}
42 changes: 42 additions & 0 deletions .github/workflows/npx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

name: houseplant / npx

on:
workflow_call:
inputs:
command:
description: npm command to run
required: true
type: string
node-version:
description: node version to install
required: false
default: '18'
type: string
node-environment:
description: node environment to use
required: false
default: 'test'
type: string

env:
NODE_ENV: ${{ inputs.node-environment }}

jobs:
npx:
name: 🪴 / npx:${{ inputs.command }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: install
uses: ./.github/actions/install
with:
node-version: ${{inputs.node-version }}

- name: npx:${{ inputs.command }}
run: npx ${{ inputs.command }}
42 changes: 42 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

name: houseplant / run

on:
workflow_call:
inputs:
command:
description: npm command to run
required: true
type: string
node-version:
description: node version to install
required: false
default: '18'
type: string
node-environment:
description: node environment to use
required: false
default: 'test'
type: string

env:
NODE_ENV: ${{ inputs.node-environment }}

jobs:
run:
name: 🪴 / run:${{ inputs.command }}
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3

- name: install
uses: ./.github/actions/install
with:
node-version: ${{inputs.node-version }}

- name: run:${{ inputs.command }}
run: npm run ${{ inputs.command }}
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

name: houseplant / test

on:
workflow_call:
inputs:
node-version:
description: node version to install
required: false
type: string
node-environment:
description: node environment to use
required: false
type: string

jobs:
unit:
name: 🧪
uses: ./.github/workflows/run.yml
with:
command: test:unit
node-version: ${{ inputs.node-version }}
node-environment: ${{ inputs.node-environment }}

e2e:
name: 🧪
uses: ./.github/workflows/run.yml
with:
command: test:e2e
node-version: ${{ inputs.node-version }}
node-environment: ${{ inputs.node-environment }}
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# dependencies
node_modules

# testing
coverage

# build
dist

# misc
.DS_Store
*.pem

# debug
npm-debug.log*

# env
.env
.env.local
Loading

0 comments on commit bd44898

Please sign in to comment.