ci: run npm scripts lint/build/test in GitHub Actions #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |