From 5222b8557043c5097acc522ca38f6b31420b0ef5 Mon Sep 17 00:00:00 2001 From: smessie Date: Mon, 26 Aug 2024 10:20:25 +0200 Subject: [PATCH] ci: Run tests on Node instead of Bun --- .github/workflows/build-test.yml | 29 +++++++++++++++-------------- .github/workflows/test.yml | 19 ------------------- README.md | 6 +++--- package.json | 3 +-- 4 files changed, 19 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 90b9a6b..4446c16 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -1,23 +1,24 @@ -name: Build & Test with Bun +name: Build and tests with Node.js on: - push: - branches: [ master ] - pull_request: - branches: [ master ] + push: + branches: [ master ] + pull_request: + branches: [ master ] jobs: build-and-test: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 # Checkout repo + - name: Checkout + uses: actions/checkout@v3 - - name: Setup Bun - uses: oven-sh/setup-bun@v1 # Setup bun - with: - bun-version: latest - - - run: bun i # Install dependencies - - run: bun test # Run tests + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 21.x + cache: "npm" + - run: npm ci + - run: npm run build + - run: npm run test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index fa849ea..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: bun-test -on: - pull_request: - push: - branches: - - 'master' -jobs: - my-job: - name: bun-test - runs-on: ubuntu-latest - steps: - # ... - - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v1 - - # run any `bun` or `bunx` command - - run: bun install - - run: bun test - diff --git a/README.md b/README.md index c45578b..4155ec7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Js-runner -[![Bun CI](https://github.com/rdf-connect/js-runner/actions/workflows/build-test.yml/badge.svg)](https://github.com/rdf-connect/js-runner/actions/workflows/build-test.yml) [![npm](https://img.shields.io/npm/v/@rdfc/js-runner.svg?style=popout)](https://npmjs.com/package/@rdfc/js-runner) +[![Build and tests with Node.js](https://github.com/rdf-connect/js-runner/actions/workflows/build-test.yml/badge.svg)](https://github.com/rdf-connect/js-runner/actions/workflows/build-test.yml) [![npm](https://img.shields.io/npm/v/@rdfc/js-runner.svg?style=popout)](https://npmjs.com/package/@rdfc/js-runner) Typescript/Javascript executor for an [RDF-Connect](https://rdf-connect.github.io/rdfc.github.io/) pipeline. Starting from a declarative RDF file describing the pipeline. @@ -34,7 +34,7 @@ You can execute this pipeline with ```bash tsc -bun bin/js-runner.js input.ttl +npx bin/js-runner.js input.ttl ``` -This example input configuration file uses `owl:imports` to specify additional configuration files. \ No newline at end of file +This example input configuration file uses `owl:imports` to specify additional configuration files. diff --git a/package.json b/package.json index f36e1f7..1f05d3e 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,7 @@ "js-runner": "bin/bundle.mjs" }, "scripts": { - "build": "tsc && tsc-alias && rollup ./dist/index.js --file ./dist/index.cjs --format cjs && bun build --external debug ./bin/js-runner.js --outfile bin/bundle.mjs --target node && npm run build:recompose", - "build:recompose": "sed -z 's/var __require = (id) => {\\n return import.meta.require(id);\\n};/import Module from \"node:module\";\\nconst __require = Module.createRequire(import.meta.url);/' -i bin/bundle.mjs", + "build": "tsc && tsc-alias", "watch": "tsc -w", "test": "vitest run --coverage --coverage.include src", "prepare": "husky",