Skip to content

Commit

Permalink
add test step
Browse files Browse the repository at this point in the history
  • Loading branch information
echo-bravo-yahoo committed Oct 24, 2024
1 parent 617b6ce commit 84394fb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 84394fb

Please sign in to comment.