Skip to content

Commit

Permalink
feat: sf-640 revamp cicd workflow (#255)
Browse files Browse the repository at this point in the history
* 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
stanleyyconsensys authored Jun 20, 2024
1 parent 9decd4b commit 6faaf02
Show file tree
Hide file tree
Showing 31 changed files with 4,587 additions and 3,128 deletions.
132 changes: 132 additions & 0 deletions .github/workflows/build-lint-test.yml
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 }}
54 changes: 0 additions & 54 deletions .github/workflows/build-test.yml

This file was deleted.

72 changes: 0 additions & 72 deletions .github/workflows/deploy-dev.yml

This file was deleted.

Loading

0 comments on commit 6faaf02

Please sign in to comment.