Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ci and so on #1

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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