Skip to content

Commit

Permalink
chore: update GitHub Actions and dependencies (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
thalesog authored Aug 19, 2024
1 parent 31ee033 commit 6785479
Show file tree
Hide file tree
Showing 7 changed files with 3,019 additions and 2,555 deletions.
40 changes: 13 additions & 27 deletions .github/workflows/check-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,37 @@ on:
jobs:
check-pr:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn

- name: Check commits messages
uses: wagoid/commitlint-github-action@v6

- name: Check PR name
uses: amannn/action-semantic-pull-request@v5

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Check types
run: yarn build
- name: Check formatting
run: yarn format

- name: Check linting
run: yarn lint

- name: Check commits messages
uses: wagoid/commitlint-github-action@v4
- name: Run build
run: yarn build

tests:
runs-on: ubuntu-latest

needs: check-pr
uses: ./.github/workflows/tests.yml

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run Tests
run: yarn test
16 changes: 11 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,35 @@ on:
- next

jobs:
tests:
uses: ./.github/workflows/tests.yml
release:
needs: test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run Tests
run: yarn test
- name: Check formatting
run: yarn format

- name: Run Build
- name: Check linting
run: yarn lint

- name: Run build
run: yarn build

- name: Run Semantic-Release
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Tests

on:
workflow_call:

jobs:
tests:
runs-on: ubuntu-latest

needs: check-pr

strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 20.x, 22.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Run Tests
run: yarn test
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint --edit "${1}"
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,40 @@
"build:main": "tsc -p tsconfig.json",
"build:module": "tsc -p tsconfig.module.json",
"lint": "eslint --ignore-path .gitignore \"src/**/*.ts\"",
"format": "prettier --ignore-path .gitignore \"src/**/*.ts\" --write",
"format": "prettier --check --ignore-path .gitignore \"src/**/*.ts\"",
"test": "vitest",
"coverage": "vitest --coverage",
"reset-hard": "git clean -dfx && git reset --hard && yarn install",
"prepare-release": "run-s reset-hard test",
"prepare": "husky install",
"prepare": "husky",
"release": "semantic-release"
},
"dependencies": {
"axios": "^1.1.3",
"axios": "^1.7.4",
"fast-text-encoding": "^1.0.6",
"qrcode": "^1.5.1"
"qrcode": "^1.5.4"
},
"devDependencies": {
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
"@semantic-release/changelog": "^6.0.1",
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/node": "^18.11.9",
"@types/qrcode": "^1.5.0",
"@types/qrcode": "^1.5.5",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"@vitest/coverage-c8": "^0.25.2",
"eslint": "^8.28.0",
"@vitest/coverage-v8": "^2.0.5",
"eslint": "8",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.2",
"lint-staged": "^13.0.3",
"husky": "^9.1.4",
"lint-staged": "^15.2.9",
"npm-run-all": "^4.1.5",
"prettier": "^2.7.1",
"semantic-release": "^19.0.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.3",
"vitest": "^0.25.2"
"prettier": "2",
"semantic-release": "^24.1.0",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
},
"files": [
"dist/main",
Expand All @@ -83,4 +83,4 @@
"yarn format"
]
}
}
}
Loading

0 comments on commit 6785479

Please sign in to comment.