Skip to content

(website) fix: set an appropriate code highlighting colour #31

(website) fix: set an appropriate code highlighting colour

(website) fix: set an appropriate code highlighting colour #31

Workflow file for this run

# This workflow will do a clean install of node dependencies, cache/restore them, 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:
packages:
name: "Build and test packages"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install root dependencies
run: npm install
- name: Bootstrap dependencies
run: npm run bootstrap
- name: Build packages
run: lerna run build
- name: Test packages
run: lerna run test
- name: Test ESM import and CJS require
run: |
set -e
cd "$TMPDIR"
mkdir test-import-require
cd test-import-require
cp -r "${{ github.workspace }}/node_modules" .
cd node_modules
mkdir \@appsync-butler
cd \@appsync-butler
ln -s "${{ github.workspace }}/packages/core" .
ln -s "${{ github.workspace }}/packages/sst" .
cd ../../
cat <<EOF > import.mjs
import { Loader } from '@appsync-butler/core';
import { SstLoader } from '@appsync-butler/sst';
console.log("ESM", Loader);
console.log("ESM", SstLoader);
EOF
cat <<EOF > require.cjs
const { Loader } = require('@appsync-butler/core');
const { SstLoader } = require('@appsync-butler/sst');
console.log("CJS", Loader);
console.log("CJS", SstLoader);
EOF
echo "Testing ESM import"
node import.mjs
echo "Testing CJS require"
node require.cjs
- name: Lint packages
run: |
set -e
if [ "${{ matrix.node-version }}" = "22.x" ]; then
lerna run lint
fi
website:
name: "Build website"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 22.4
uses: actions/setup-node@v4
with:
node-version: 22.4
- name: Install root dependencies
run: npm install
- name: Bootstrap dependencies
run: npm run bootstrap
- name: Build packages
run: lerna run build
- name: Install website dependencies
working-directory: ./website
run: npm install
- name: Build website
working-directory: ./website
run: npm run build