From 84394fb93eb4885d407b830f03f168b3ce70459a Mon Sep 17 00:00:00 2001 From: Ashton Eby Date: Thu, 24 Oct 2024 15:18:35 -0700 Subject: [PATCH] add test step --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ddc654a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +# This uses `npm ci --omit=dev --include=peer --include=optional` to get a +# bundle of only prod dependencies, then runs `npm test`, which checks the exit +# code of running our config files. This is a quick smoke test to make sure +# that we have our dependencies installed correctly for consumers. + +name: Test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "*" ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js (22.x) + uses: actions/setup-node@v4 + with: + node-version: 22.x + registry-url: 'https://registry.npmjs.org' + cache: 'npm' + - run: npm ci --omit=dev --include=peer --include=optional + - run: npm test diff --git a/package-lock.json b/package-lock.json index 32e736c..d392772 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@fauna/typescript", - "version": "0.0.7", + "version": "0.0.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@fauna/typescript", - "version": "0.0.7", + "version": "0.0.9", "license": "MPL-2.0", "dependencies": { "@eslint/js": "^9.13.0", diff --git a/package.json b/package.json index 0b7cfb2..e7a0608 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "A collection of lint, format, and build configs used at Fauna for TypeScript projects.", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "find ./config -name '*.js' -print0 | xargs -0 -n1 node", "build": "cp ./config/.gitignore .gitignore", "bump": "node ./scripts/version-bump.js" },