Skip to content

Commit

Permalink
ci: add lint and build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
jamieweavis committed Aug 23, 2023
1 parent 6e503c3 commit e22adee
Showing 1 changed file with 46 additions and 20 deletions.
66 changes: 46 additions & 20 deletions .github/workflows/build.yml
@@ -1,6 +1,3 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: build

on:
Expand All @@ -10,29 +7,64 @@ on:
branches: [main]

jobs:
test:
name: Test
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]

steps:
- name: Checkout
uses: actions/checkout@v2

uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
persist-credentials: false

cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint

build:
needs: [lint]
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build --if-present
run: npm run build

test:
needs: [build]
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test

Expand All @@ -42,17 +74,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

uses: actions/checkout@v3
- name: Install dependencies
run: npm ci

- name: Build
run: npm run build --if-present

run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit e22adee

Please sign in to comment.