Skip to content

Update actions/download-artifact digest to 2a59741 #4943

Update actions/download-artifact digest to 2a59741

Update actions/download-artifact digest to 2a59741 #4943

name: 'CI build & test'
on:
push:
branches: '*'
pull_request:
branches: '*'
permissions: read-all
jobs:
verify-formatting:
name: Verify code formatting
permissions:
contents: read
# Blacksmith is much faster and gives better dashboards than github actions, but we are not being sponsored anymore so had to revert.
# runs-on: blacksmith-4vcpu-ubuntu-2204
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Setup Node
# Blacksmith is much faster and gives better dashboards than github actions, but we are not being sponsored anymore so had to revert.
# uses: useblacksmith/setup-node@65c6ca86fdeb0ab3d85e78f57e4f6a7e4780b391 # v5.0.4
uses: actions/setup-node@v4
with:
node-version: '24.x'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Verify formatting
run: yarn test-format-all
build:
name: Build from source files
needs: []
permissions:
contents: write
# Blacksmith is much faster and gives better dashboards than github actions, but we are not being sponsored anymore so had to revert.
# runs-on: blacksmith-4vcpu-ubuntu-2204
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Setup Node
# Blacksmith is much faster and gives better dashboards than github actions, but we are not being sponsored anymore so had to revert.
# uses: useblacksmith/setup-node@65c6ca86fdeb0ab3d85e78f57e4f6a7e4780b391 # v5.0.4
uses: actions/setup-node@v4
with:
node-version: '24.x'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build project
run: yarn build-only
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: dist
path: dist/
- name: Package node_modules
run: tar --exclude='.cache' -cvf node_modules.tar node_modules
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: node_modules
path: node_modules.tar
test-suite-node:
name: Test suite for Node
permissions:
contents: read
needs: [build, verify-formatting]
# Blacksmith is much faster and gives better dashboards than github actions, but we are not being sponsored anymore so had to revert.
# runs-on: blacksmith-4vcpu-ubuntu-2204
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x, 22.x, 24.x] # Dropped '23.x' (EOL) and 'latest' for stability
steps:
- name: Harden Runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Setup Node
# Blacksmith is much faster and gives better dashboards than github actions, but we are not being sponsored anymore so had to revert.
# uses: useblacksmith/setup-node@65c6ca86fdeb0ab3d85e78f57e4f6a7e4780b391 # v5.0.4
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- uses: actions/download-artifact@2a5974104b6d5dbdb2f9468a3e54da3bdd241578 # master
with:
name: dist
path: dist/
- uses: actions/download-artifact@2a5974104b6d5dbdb2f9468a3e54da3bdd241578 # master
with:
name: node_modules
path: ./
- name: Unpack node_modules
run: tar -xvf node_modules.tar
- name: Run test suite
run: yarn test-only
test-suite-browser:
name: Test suite for Browser
permissions:
contents: read
needs: [build, verify-formatting]
# Blacksmith is much faster and gives better dashboards than github actions, but we are not being sponsored anymore so had to revert.
# runs-on: blacksmith-4vcpu-ubuntu-2204
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- uses: actions/download-artifact@2a5974104b6d5dbdb2f9468a3e54da3bdd241578 # master
with:
name: dist
path: dist/
- name: Placeholder for browser tests
run: echo '::warning ::Not able to automate browser tests yet'
- name: Run browser tests (disabled)
run: '# yarn test-browser-ci'
verify-parser:
name: Verify grammar vs generated parser
needs: []
permissions:
contents: read
# Blacksmith is much faster and gives better dashboards than github actions, but we are not being sponsored anymore so had to revert.
# runs-on: blacksmith-4vcpu-ubuntu-2204
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
- name: Get changed files
id: detect-changes
uses: tj-actions/changed-files@v47.0.6
with:
files: src/alasqlparser.jison
- name: Setup Bun
if: steps.detect-changes.outputs.any_changed == 'true'
uses: oven-sh/setup-bun@v2
- name: Build from src
# This step only runs if the jison file changed
if: steps.detect-changes.outputs.any_changed == 'true'
run: |
yarn install --frozen-lockfile
yarn jison
yarn test
- name: Check generated parser for changes
if: steps.detect-changes.outputs.any_changed == 'true'
run: |
git diff --exit-code -- src/alasqlparser.js || (echo "Please run 'yarn jison && yarn test' and commit again." && exit 1)