From b951baa74c51fbbe412d06cc7c0033bfc942848c 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.json | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) 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.json b/package.json index 71b0ffb..129697a 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" },