Skip to content

Commit

Permalink
Add GitHub workflows
Browse files Browse the repository at this point in the history
Add GitHub workflows
  • Loading branch information
rtivital authored Nov 9, 2023
2 parents 4b9e1ef + 3d45227 commit d98d80c
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 147 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pull request workflow

on:
pull_request:
branches:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
test_pull_request:
runs-on: ubuntu-latest
steps:
- name: Get Yarn cache path
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '20.9.0'
- name: Load Yarn cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
run: npm test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Included tools:
- jest
- prettier
- ESLint
- GitHub workflow for tests

## Usage

Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"url": "https://github.com/rtivital/ts-package-template/issues"
},
"homepage": "https://github.com/rtivital/ts-package-template#readme",
"main": "./dist/cjs/index.js",
"main": "./dist/cjs/index.cjs",
"types": "./dist/types/index.d.ts",
"module": "./dist/esm/index.mjs",
"exports": {
Expand All @@ -32,7 +32,7 @@
},
"require": {
"types": "./dist/types/index.d.ts",
"default": "./dist/cjs/index.js"
"default": "./dist/cjs/index.cjs"
}
}
},
Expand All @@ -45,22 +45,22 @@
"typecheck": "tsc --noEmit",
"lint": "eslint --cache --ext .ts,.tsx .",
"jest": "jest",
"test": "npm run prettier:check && npm run typecheck && npm run lint && npm run jest",
"test": "npm run prettier:check && npm run typecheck && npm run lint && npm run jest && npm run build",
"release": "npm test && esno scripts/release"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.4",
"@rollup/plugin-replace": "^5.0.5",
"@types/fs-extra": "^11",
"@types/jest": "^29.5.6",
"@types/node": "^20.8.9",
"@types/jest": "^29.5.8",
"@types/node": "^20.9.0",
"@types/signale": "^1",
"@types/yargs": "^17.0.29",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"@types/yargs": "^17.0.31",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"esbuild": "^0.19.5",
"eslint": "^8.52.0",
"eslint": "^8.53.0",
"esno": "^0.17.0",
"execa": "^8.0.1",
"fs-extra": "^11.1.1",
Expand All @@ -69,7 +69,7 @@
"open": "^9.1.0",
"prettier": "^3.0.3",
"rimraf": "^5.0.5",
"rollup": "^4.1.4",
"rollup": "^4.3.0",
"rollup-plugin-esbuild": "^6.1.0",
"rollup-plugin-node-externals": "^6.1.2",
"signale": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default {
input: path.join(process.cwd(), './src/index.ts'),
output: [
{ format: 'es', file: './dist/esm/index.mjs' },
{ format: 'cjs', file: './dist/cjs/index.js' },
{ format: 'cjs', file: './dist/cjs/index.cjs' },
],
plugins: [
commonjs(),
Expand Down
Loading

0 comments on commit d98d80c

Please sign in to comment.