Skip to content

ci: run npm scripts lint/build/test in GitHub Actions #3

ci: run npm scripts lint/build/test in GitHub Actions

ci: run npm scripts lint/build/test in GitHub Actions #3

name: Continuous Integration
on:
push:
branches:
- main
pull_request:
jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: |
npm ci
npm ls
lint:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: |
npm ci
- name: "Continuous Integration: lint"
run: |
npm run --if-present lint
build:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: |
npm ci
- name: "Continuous Integration: build"
env:
BASE_URL: "/utrecht/"
run: |
npm run --if-present build
- name: "Retain build artifact: build"
uses: actions/upload-artifact@v3
with:
name: nlds-community-blocks
path: nlds-community-blocks.zip
retention-days: 14
test:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Set up Node.js version
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: |
npm ci
- name: "Continuous Integration: test"
run: |
npm run --if-present test