diff --git a/.github/workflows/quality-check.yml b/.github/workflows/quality-check.yml new file mode 100644 index 0000000..857ae55 --- /dev/null +++ b/.github/workflows/quality-check.yml @@ -0,0 +1,28 @@ +name: quality-check +run-name: ${{ github.actor }} triggered a quality check +on: [push] +jobs: + quality-check: + name: run-check for ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - uses: actions/checkout@v4.1.1 + - uses: actions/setup-node@v4.0.2 + with: + # Use Node 20 LTS + node-version: 'lts/Iron' + # Install dependencies + - run: npm cache clean --force + - run: npm set registry https://registry.npmjs.org/ + - run: npm ci + # Run tests + - run: npm run test + # Check formatting + - run: npm run formatting + # Run linter + - run: npm run lint + # Ensure code compiles + - run: npm run build diff --git a/.gitignore b/.gitignore index a8d7c85..53b1dae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.log .DS_Store node_modules -dist \ No newline at end of file +dist +coverage diff --git a/package.json b/package.json index 5b9d4f1..f3e26ca 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,13 @@ "version": "1.0.0", "description": "Implement TypeScript-native CESR primitives.", "main": "index.js", - "scripts": { + "scripts": { "start": "ts-node index.ts", - "test": "node --test --require ts-node/register **/*.test.ts", - "lint": "eslint --ext .ts . && prettier . --check", - "fix": "eslint --ext .ts . --fix && prettier . --write", + "test": "jest", + "formatting": "prettier . --check", + "lint": "eslint --ext .ts .", + "fix-lint": "eslint --ext .ts . --fix", + "fix-formatting": "prettier . --write", "build": "tsc" }, "repository": {