Skip to content

Create node.js.yml #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This file is copied from https://github.com/source-academy/js-slang/blob/master/.github/workflows/nodejs.yml
# 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: Node.js CI

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

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Check for package-lock.json
run: |
if [ -e package-lock.json ]; then
echo "package-lock.json found; please do not use NPM! This project uses Yarn!"
exit 1
fi
exit 0
- name: Install dependencies (apt)
run: |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
texlive texlive-fonts-extra texlive-lang-cjk latexmk latex-cjk-all
# Has to be run before actions/setup-node.
# See: https://github.com/actions/setup-node/issues/480
- name: Enable corepack for Yarn
run: corepack enable
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --immutable
- run: yarn build
- run: yarn format:ci
- run: yarn eslint
- run: yarn test-coverage
env:
CI: true
Loading