Skip to content

Commit

Permalink
Add a PR check workflow (#38)
Browse files Browse the repository at this point in the history
* Add a PR check workflow

* Prettier fixes
  • Loading branch information
pcholakov authored Sep 2, 2024
1 parent 1a91034 commit edd4ccf
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 122 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: PR Checks (npm)

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run test
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Publish package to NPM
on:
release:
types: [ published ]
types: [published]
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm run test
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build and test

on:
push:
branches: [ main ]
branches: [main]

jobs:
build:
Expand All @@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm run test
Expand Down
10 changes: 5 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
testEnvironment: 'node',
roots: ['<rootDir>/test'],
testMatch: ['**/*.test.ts'],
testEnvironment: "node",
roots: ["<rootDir>/test"],
testMatch: ["**/*.test.ts"],
transform: {
'^.+\\.tsx?$': 'ts-jest'
}
"^.+\\.tsx?$": "ts-jest",
},
};
Loading

0 comments on commit edd4ccf

Please sign in to comment.