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 26, 2023
1 parent fc03960 commit 66bf190
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "CodeQL"
name: "codeql-analysis"
on:
push:
branches: [ main ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ '*' ]

jobs:
test-cryptogen:
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.

20 changes: 20 additions & 0 deletions .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Test Report'
on:
workflow_run:
workflows: [ 'unit-test' ] # runs after CI workflow
types:
- completed
permissions:
contents: read
actions: read
checks: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: test-results # artifact name
name: JEST Tests # Name of the check run which will be created
path: '*.xml' # Path to test results (inside artifact .zip)
reporter: jest-junit # Format of test results
10 changes: 8 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ '*' ]

jobs:
unit-test:
Expand All @@ -17,4 +17,10 @@ jobs:
cache: 'npm'
- run: npm ci
- run: npm run build:console
- run: npm run test:coverage
- run: npm run test:junit

- uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results
path: coverage/junit.xml
Loading

0 comments on commit 66bf190

Please sign in to comment.