Skip to content

refactor(cli): support on TS 5.x and 6.x #160

refactor(cli): support on TS 5.x and 6.x

refactor(cli): support on TS 5.x and 6.x #160

Workflow file for this run

name: tests
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
runs-on: [ ubuntu-latest ]
strategy:
fail-fast: false
matrix:
node: [ "lts/-1", "lts/-2", "lts/*" ]
package:
- name: sparqlc
path: packages/sparqlc
- name: esbuild-plugin-sparql
path: packages/esbuild-plugin-sparql
- name: node-loader-sparql
path: packages/node-loader-sparql
- name: vite-plugin-sparql
path: packages/vite-plugin-sparql
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run -w sparqlc build
if: ${{ matrix.package.name != 'sparqlc' }}
- run: npx playwright install
if: ${{ matrix.package.name == 'vite-plugin-sparql' }}
- run: npx c8 --all --src ${{ matrix.package.path }} --include ${{ matrix.package.path }} --reporter lcovonly --reporter text npm run -w ${{ matrix.package.name }} test
- name: Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.package.name }}
sparql-cli:
name: sparql-cli (TS ${{ matrix.typescript }}, node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [ "lts/*" ]
typescript: [ "5", "6" ]
include:
- node: "lts/-1"
typescript: "5"
- node: "lts/-2"
typescript: "5"
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run -w sparqlc build
- name: Install target TypeScript version in sparqlc-cli
run: npm install --no-save typescript@${{ matrix.typescript }} -w packages/sparqlc-cli
- name: Run CLI tests against target TypeScript version
run: npx c8 --all --src packages/sparqlc-cli --include packages/sparqlc-cli --reporter lcovonly --reporter text npm run -w sparqlc-cli test
- name: Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: sparqlc-cli
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: lts/*
- run: npm ci
- run: npm run lint
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: lts/*
- run: npm ci
- run: npm run -ws --if-present build