Skip to content

Commit

Permalink
Update ci and so on (#1)
Browse files Browse the repository at this point in the history
* ci: update

* switch to @nmshd package

* stuff

* re-add jest types
  • Loading branch information
jkoenig134 authored Oct 14, 2024
1 parent 7f203ae commit 8d14b9d
Show file tree
Hide file tree
Showing 79 changed files with 1,543 additions and 4,992 deletions.
6 changes: 6 additions & 0 deletions .ci/runChecks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set -e

npm ci
npm run build
npx license-check
npx better-npm-audit audit
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
groups:
update-github-actions-dependencies:
patterns:
- '*'
reviewers:
- 'jkoenig134'
labels:
- 'dependencies'

- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
groups:
update-npm-dependencies:
patterns:
- '*'
reviewers:
- 'jkoenig134'
labels:
- 'dependencies'
32 changes: 0 additions & 32 deletions .github/workflows/master.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/npm-publish.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish

on:
push:
branches: [master]

jobs:
run-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: current
- run: bash .ci/runChecks.sh

publish-npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: current
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npx enhanced-publish --if-possible --use-preid-as-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
needs: ['run-checks']
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test

on:
pull_request:
push:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
run-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: current
- run: bash .ci/runChecks.sh

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: current
- run: npm ci
- run: npm run build
- run: npm run test
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.DS_Store
doc
node_modules
.vscode
.nyc_output
coverage
*.log
npm-debug.log*
.idea
reports
reports
dist
27 changes: 27 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"semi": true,
"tabWidth": 4,
"singleQuote": true,
"printWidth": 120,
"trailingComma": "none",
"overrides": [
{
"files": "*.json",
"options": {
"tabWidth": 2
}
},
{
"files": "*.yml",
"options": {
"tabWidth": 2
}
},
{
"files": ".prettierrc",
"options": {
"tabWidth": 2
}
}
]
}
31 changes: 31 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"files.autoSave": "off",
"html.format.wrapAttributes": "preserve-aligned",
"xmlTools.splitAttributesOnFormat": true,
"xmlTools.enforcePrettySelfClosingTagOnFormat": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "always"
},
"files.eol": "\n",
"typescript.tsdk": "node_modules/typescript/lib"
}
Loading

0 comments on commit 8d14b9d

Please sign in to comment.