Skip to content

Commit

Permalink
fix: upgrade action (#84)
Browse files Browse the repository at this point in the history
* refactor: upgrade action version

* feat: codeQL static analytic

* feat: delete sonarqube and add new action
  • Loading branch information
kidneyweakx authored Sep 27, 2023
1 parent b424fe2 commit 3be4e4f
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 140 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "codeql-analysis"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 0' # Run at midnight on Sunday

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [javascript]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
11 changes: 7 additions & 4 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ jobs:
test-cryptogen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- 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: ./cicd/test_script/cryptogen.sh

test-ca:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- 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: ./cicd/test_script/ca.sh
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/lint-and-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,17 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: [ '*' ]

jobs:
lint:
lint-and-compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
- run: npm run eslint
compile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run build-ts
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 }}
24 changes: 0 additions & 24 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
10 changes: 8 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- 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:coverage

- uses: VeryGoodOpenSource/very_good_coverage@v2
with:
path: './coverage/lcov.info'
min_coverage: 70
Loading

0 comments on commit 3be4e4f

Please sign in to comment.