-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: sf-640 revamp cicd workflow (#255)
* feat: add new cd workflow * feat: add code scan * chore: update code scan in duel process * chore: merge sonar scan in test workflow * chore: add token for scan * chore: restore report coverage from specific node version * fix: update secret * fix: missing node version on the cache key * chore: add webpack config for diff ENV * chore: update get-starknet cmd * chore: update get starknet build config * chore: update get-starknet webpack * chore: update deployment * chore: update get starknet package in release please * chore: update deploy yml * chore: update yarn.lock * fix: lint issue
- Loading branch information
1 parent
9decd4b
commit 6faaf02
Showing
31 changed files
with
4,587 additions
and
3,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
name: Build, Lint, Test and Scan | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
SONAR_TOKEN_WALLET_UI: | ||
required: true | ||
SONAR_TOKEN_STARKNET_SNAP: | ||
required: true | ||
|
||
jobs: | ||
prepare: | ||
name: Prepare | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
- name: Install Yarn dependencies | ||
run: yarn --no-immutable | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
needs: | ||
- prepare | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
- name: Cache NPM tarballs | ||
id: cache-npm-tarballs | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
node_modules/.cache/npm | ||
key: npm-tarballs-${{ github.run_id }} | ||
restore-keys: | | ||
npm-tarballs | ||
- run: yarn --no-immutable | ||
- run: yarn build | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
needs: | ||
- prepare | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'yarn' | ||
- run: yarn --no-immutable | ||
- run: yarn lint | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
needs: | ||
- prepare | ||
strategy: | ||
matrix: | ||
node-version: [18.x, 20.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' | ||
- run: yarn --no-immutable | ||
- run: yarn build | ||
- run: yarn test | ||
- name: Cache Coverage Report | ||
uses: actions/cache@v3 | ||
id: cache-coverage-report | ||
with: | ||
path: | | ||
./packages/**/coverage | ||
key: ${{ github.sha }}-${{ matrix.node-version }}-coverage-report | ||
|
||
code-scan-snap: | ||
name: Scan Starknet Snap | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Restore Coverage Report | ||
uses: actions/cache@v3 | ||
id: restore-coverage-report | ||
with: | ||
path: | | ||
./packages/**/coverage | ||
key: ${{ github.sha }}-20.x-coverage-report | ||
- name: SonarCloud Scan Starknet-Snap | ||
uses: SonarSource/[email protected] | ||
with: | ||
projectBaseDir: packages/starknet-snap/ | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_STARKNET_SNAP }} | ||
|
||
code-scan-wallet-ui: | ||
name: Scan Wallet UI | ||
runs-on: ubuntu-latest | ||
needs: | ||
- test | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Restore Coverage Report | ||
uses: actions/cache@v3 | ||
id: restore-coverage-report | ||
with: | ||
path: | | ||
./packages/**/coverage | ||
key: ${{ github.sha }}-20.x-coverage-report | ||
- name: SonarCloud Scan Wallet-UI | ||
uses: SonarSource/[email protected] | ||
with: | ||
projectBaseDir: packages/wallet-ui/ | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_WALLET_UI }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.