Skip to content

Commit

Permalink
chore: dependencies and refactor ci (#506)
Browse files Browse the repository at this point in the history
* chore: bump node version to 20

* chore update dependencies

* chore update dependencies

* chore: bump node version to 20
  • Loading branch information
npalm committed Feb 4, 2024
1 parent e1f40b0 commit 44af6c0
Show file tree
Hide file tree
Showing 7 changed files with 1,082 additions and 1,240 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
name: 'build-test'
name: "build"
on:
push:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
types: [opened, synchronize, reopened]

jobs:
build:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["16", "18"]
node-version: ["20"]
steps:
- uses: actions/checkout@b56e6a3d768b11aef1d4c73977caf6413c0d74c8 # v3.2.0
with:
fetch-depth: 0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install --ignore-engines
run: yarn install

- name: Check format and lint
if: matrix.node-version == 16
run: yarn run format-check && yarn run lint

- name: Run tests
run: yarn test

- name: Build and package
if: matrix.node-version == 16
run: yarn run build
7 changes: 3 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ name: 'Code scanning'

on:
push:
branches: [ develop, main ]
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
schedule:
- cron: '0 22 * * 0'
branches: [ main ]


jobs:
CodeQL-Build:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 18
node-version: 20

- name: Install dependencies
run: yarn
Expand All @@ -36,8 +36,6 @@ jobs:
release-type: node
package-name: action-docs
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false},{"type":"build","section":"Miscellaneous","hidden":true}]'
last-release-sha: 26343d22fecbbc6bc273ee0b7b80b9267c587d6a
release-as: v1.3.0
- name: Publish to NPM
run: yarn publish
if: ${{ steps.release.outputs.release_created }}
Expand Down
73 changes: 37 additions & 36 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
name: 'sonar'
on:
push:
branches:
- main
# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target for security implications.
pull_request_target:
types: [opened, synchronize, reopened]
# name: 'sonar'
# on:
# push:
# branches:
# - main
# # See https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target for security implications.
# pull_request_target:
# types: [opened, synchronize, reopened]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b56e6a3d768b11aef1d4c73977caf6413c0d74c8 # v3.2.0
with:
fetch-depth: 0
# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@b56e6a3d768b11aef1d4c73977caf6413c0d74c8 # v3.2.0
# with:
# fetch-depth: 0

- name: Get info
id: info
run: |
echo "repo_name=$(echo $GITHUB_REPOSITORY| cut -d / -f 2)" >> $GITHUB_OUTPUT
echo "repo_owner=$(echo $GITHUB_REPOSITORY| cut -d / -f 1)" >> $GITHUB_OUTPUT
# - name: Get info
# id: info
# run: |
# echo "repo_name=$(echo $GITHUB_REPOSITORY| cut -d / -f 2)" >> $GITHUB_OUTPUT
# echo "repo_owner=$(echo $GITHUB_REPOSITORY| cut -d / -f 1)" >> $GITHUB_OUTPUT

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 18
- name: Install dependencies
run: yarn install --ignore-engines
# - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
# with:
# node-version: 18
# - name: Install dependencies
# run: yarn install --ignore-engines

- name: Run all checks and build
run: yarn run all

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@db501078e936e4b4c8773d1bb949ba9ddb7b6b6a # v1.9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=${{ steps.info.outputs.repo_owner }}
-Dsonar.projectKey=${{ steps.info.outputs.repo_name }}
# - name: Run all checks and build
# run: yarn run all

# - name: SonarCloud Scan
# uses: sonarsource/sonarcloud-github-action@db501078e936e4b4c8773d1bb949ba9ddb7b6b6a # v1.9
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# with:
# args: >
# -Dsonar.organization=${{ steps.info.outputs.repo_owner }}
# -Dsonar.projectKey=${{ steps.info.outputs.repo_name }}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18
v20
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
],
"devDependencies": {
"@types/figlet": "^1.5.0",
"@types/jest": "^29.5.0",
"@types/jest": "^29.5.12",
"@types/showdown": "^2.0.6",
"@typescript-eslint/parser": "^6.20.0",
"eslint": "^8.56.0",
Expand All @@ -59,7 +59,7 @@
"eslint-plugin-prettier": "^5.1.0",
"jest": "^29.7.0",
"nyc": "^15.1.0",
"prettier": "^3.2.0",
"prettier": "^3.2.5",
"semantic-release": "^23.0.0",
"ts-jest": "^29.1.0",
"typescript": "^5.3.0",
Expand Down

0 comments on commit 44af6c0

Please sign in to comment.