Skip to content

Commit

Permalink
feat: delete sonarqube and add new action
Browse files Browse the repository at this point in the history
  • Loading branch information
kidneyweakx committed Sep 27, 2023
1 parent fc03960 commit 06e1e05
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 125 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: "CodeQL"
name: "codeql-analysis"
on:
push:
branches: [ main ]
pull_request:
branches: [ '*' ]
branches: [ main ]
schedule:
- cron: '0 0 * * 0' # Run at midnight on Sunday

jobs:
analyze:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/publish-npm-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish-npm-package
on:
release:
types: [ published ]
jobs:
github-packages:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@cathayddt'
- run: npm ci
- run: npm run build:console
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

npm-registry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
# how to fix the package name
- run: |
sed -i 's/"name": "@cathayddt\/bdk"/"name": "@cathaybc\/bdk"/' package.json
npm install
- run: npm run build:console
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 0 additions & 25 deletions .github/workflows/sonarqube.yml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: test-report
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
permissions:
contents: read
actions: read
checks: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm run build:console
- run: npm run test:json

- uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: mocha-report # Name of the check run which will be created
path: 'test-*.json' # Path to test results (inside artifact .zip)
reporter: mocha-json # Format of test results
5 changes: 5 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ jobs:
- run: npm ci
- run: npm run build:console
- run: npm run test:coverage

- uses: VeryGoodOpenSource/very_good_coverage@v2
with:
path: './coverage/lcov.info'
min_coverage: 70
126 changes: 36 additions & 90 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"test:quorum": "nyc npm run test -- --grep Quorum",
"test:fabric": "nyc npm run test -- --grep Fabric",
"test:coverage": "nyc npm run test",
"test:sonar": "NODE_ENV=testing nyc --reporter=lcov mocha --reporter mocha-sonarqube-reporter --reporter-options output=coverage/xunit.xml --require ts-node/register ./test/**/*.test.ts --exit",
"test:json": "NODE_ENV=testing BDK_PATH=$(pwd)/test/bdk BDK_DOCKER_HOST_PATH=$(pwd)/test/bdk mocha --reporter json --require ts-node/register ./test/**/*.test.ts --exit > test-results.json",
"git:changelog": "git-cliff --unreleased --tag 2.0.3 --prepend CHANGELOG.md",
"doc:create": "npx typedoc --readme none --out ./api-docs --packages ."
},
Expand Down Expand Up @@ -85,7 +85,6 @@
"eslint-plugin-react": "^7.32.2",
"git-cliff": "^1.2.0",
"mocha": "^9.1.3",
"mocha-sonarqube-reporter": "^1.0.2",
"nodemon": "^2.0.15",
"nyc": "^15.1.0",
"semver": "^7.3.5",
Expand Down
Loading

0 comments on commit 06e1e05

Please sign in to comment.