Skip to content

Commit

Permalink
Add github action to lint and test (#6)
Browse files Browse the repository at this point in the history
* add gh action for testing

* update action version

* update dependencies

* update eslint

* update test
  • Loading branch information
ethangardner authored Nov 30, 2024
1 parent 9f7884b commit eaf762f
Show file tree
Hide file tree
Showing 7 changed files with 1,063 additions and 3,738 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test

on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
# Use the same Node.js version as specified in your .nvmrc file
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm install

- name: Run linters
run: npm run lint

- name: Run tests
run: npm test
18 changes: 18 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';

export default [
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{
files: ['web-test-runner.config.js', 'web-dev-server.config.js'],
languageOptions: { globals: globals.node },
},
{ ignores: ['dist/**'] },
{ languageOptions: { globals: globals.browser } },

pluginJs.configs.recommended,
...tseslint.configs.strict,
...tseslint.configs.stylistic,
...tseslint.configs.recommended,
];
Loading

0 comments on commit eaf762f

Please sign in to comment.