From cf56b012e6c0d98f87362a4c2daff49f856a1cba Mon Sep 17 00:00:00 2001 From: Malachi Soord Date: Sun, 14 Jan 2024 20:50:32 +0100 Subject: [PATCH 1/2] Add basic CI pipeline --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ .nvmrc | 1 + 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .nvmrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7cf81bf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Lint JavaScript code + run: npx run eslint lib/**/*.js + + - name: Build JavaScript code + run: npm run build diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..8b0beab --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.11.0 From fbf5d7b8d976dea5d112525f8404b1bbfa692ae2 Mon Sep 17 00:00:00 2001 From: Malachi Soord Date: Sun, 28 Jan 2024 09:10:46 +0100 Subject: [PATCH 2/2] Split CI processes --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cf81bf..2eb6692 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,29 @@ on: - master jobs: - build: + lint: runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Run ESLint + run: npx eslint lib/**/*.js + - name: Run Prettier + run: npx prettier --check lib/ + + lint-manifest: + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 @@ -25,8 +45,23 @@ jobs: - name: Install dependencies run: npm ci - - name: Lint JavaScript code - run: npx run eslint lib/**/*.js + - name: Lint manifest + run: npm run lint:manifest + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "npm" + + - name: Install dependencies + run: npm ci - name: Build JavaScript code run: npm run build