Skip to content

Commit

Permalink
👷 GitHub CI workflow
Browse files Browse the repository at this point in the history
Creates CI workflow that runs the build. Configures Prettier for YAML.
  • Loading branch information
connorjs committed Dec 23, 2023
1 parent ca72473 commit 349e3ba
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

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

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: .node-version
- name: Install
run: npm ci
- name: CI build
run: npm run ci-build
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
4 changes: 0 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ The [src](./src) directory contains the main and test sources.

All contributions MUST adhere to the following expectations.

> **Note**
>
> I have not configured any GitHub actions yet.
1. Every change MUST have unit tests.
2. Every change MUST have a GitHub issue linked.
3. Any configuration option change MUST be discussed in a GitHub issue first.
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
"*.md": `prettier -w`,
"*.{cjs,js,json}": [`prettier -w`, `eslint -f pretty --fix`],
"*.{md,yaml,yml}": `prettier -w`,
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"scripts": {
"build": "rm -rf dist && mkdir -p dist && cp src/main.js src/logic.js dist",
"ci-build": "npm-run-all -l -p format lint test build",
"format": "prettier -l '**/*.{cjs,js,json,md}' --ignore-path .gitignore",
"format": "prettier -l '**/*.{cjs,js,json,md,yaml,yml}' --ignore-path .gitignore",
"lint": "eslint -f pretty .",
"prepare": "is-ci || husky install",
"prepublishOnly": "npm run ci-build",
Expand Down

0 comments on commit 349e3ba

Please sign in to comment.