Skip to content

Feat/integrate gem wallet #2

Feat/integrate gem wallet

Feat/integrate gem wallet #2

Workflow file for this run

name: Check PR
on:
pull_request:
types: [opened, reopened, synchronize, labeled]
jobs:
check-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare
uses: ./.github/actions/prepare
- name: Checking Conventional Commits
run: node ./scripts/check-conventional-commits/command.mjs
env:
REF: ${{ github.ref }}
build-libs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare
uses: ./.github/actions/prepare
- name: Extract new translation keys and check if any error exists
run: node ./scripts/lingui/command.js extract --clean
- name: Compile new translation keys
run: yarn run i18n:compile
- name: Build Libs
run: node ./scripts/build-libs/command.mjs
- id: upload-artifacts
name: Upload Build Artifacts
uses: ./.github/actions/upload-build-artifacts
outputs:
hashed_branch: ${{ steps.upload-artifacts.outputs.hashed }}
run-tests:
runs-on: ubuntu-latest
needs: build-libs
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Build Information For Current Branch
uses: actions/download-artifact@v4
with:
name: ${{needs.build-libs.outputs.hashed_branch}}
- name: Prepare
uses: ./.github/actions/prepare
- name: Test
run: yarn run test
deploy:
runs-on: ubuntu-latest
needs: [build-libs, run-tests]
environment: preview
env:
REACT_APP_PLAYGROUND_RANGO_API_KEY: ${{ vars.PLAYGROUND_RANGO_API_KEY }}
REACT_APP_RANGO_API_KEY: ${{ vars.RANGO_API_KEY }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare
uses: ./.github/actions/prepare
- name: Download Build Information For Current Branch
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: ${{needs.build-libs.outputs.hashed_branch}}
- name: Build & Deploy
uses: ./.github/actions/build-deploy
id: build-deploy
with:
PLAYGROUND_RANGO_API_KEY: ${{ vars.PLAYGROUND_RANGO_API_KEY }}
RANGO_API_KEY: ${{ vars.RANGO_API_KEY }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_WIDGET_CONFIG: ${{ secrets.VERCEL_PROJECT_WIDGET_CONFIG }}
VERCEL_PROJECT_WIDGET_APP: ${{ secrets.VERCEL_PROJECT_WIDGET_APP }}
VERCEL_PROJECT_STORYBOOK: ${{ secrets.VERCEL_PROJECT_STORYBOOK }}
VERCEL_PROJECT_Q: ${{ secrets.VERCEL_PROJECT_Q }}
ENABLE_PREVIEW_DEPLOY: true
outputs:
# the structure of output variable is {packageNameWithoutScope}-url like: widget-app-url
app_url: ${{ steps.build-deploy.outputs.app_url }}
playground_url: ${{ steps.build-deploy.outputs.playground_url }}
storybook_url: ${{ steps.build-deploy.outputs.storybook_url }}
# add job for each project that you want has preview deployment
app-preview:
runs-on: ubuntu-latest
needs: deploy
environment:
name: app-preview
url: ${{ steps.seturl.outputs.url }}
steps:
- name: Extract Preview URL
id: seturl
run: |
echo "url=${{ needs.deploy.outputs.app_url }}">> $GITHUB_OUTPUT
echo "Preview URL: ${{ needs.deploy.outputs.app_url}}"
playground-preview:
runs-on: ubuntu-latest
needs: deploy
environment:
name: playground-preview
url: ${{ steps.seturl.outputs.url }}
steps:
- name: Extract Preview URL
id: seturl
run: |
echo "url=${{ needs.deploy.outputs.playground_url }}">> $GITHUB_OUTPUT
echo "Preview URL: ${{ needs.deploy.outputs.playground_url}}"
storybook-preview:
runs-on: ubuntu-latest
needs: deploy
environment:
name: storybook-preview
url: ${{ steps.seturl.outputs.url }}
steps:
- name: Extract Preview URL
id: seturl
run: |
echo "url=${{ needs.deploy.outputs.storybook_url }}">> $GITHUB_OUTPUT
echo "Preview URL: ${{ needs.deploy.outputs.storybook_url}}"
analyze-bundle:
needs: [build-libs, run-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Prepare
uses: ./.github/actions/prepare
- name: Download Build Information For Current Branch
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: ${{needs.build-libs.outputs.hashed_branch}}
- name: Hash Target Branch Name
id: hash_target_branch_name
run: |
hashed_name=$(printf "%s" "${{ github.base_ref }}" | base64 -w 0)
echo "hashed=${hashed_name}">> $GITHUB_OUTPUT
- name: Analyze Bundles And Create Report
run: node ./scripts/analyze-bundle/command.mjs --currentBranchDirectory current-branch --targetBranchDirectory target-branch --targetBranchArtifactName ${{steps.hash_target_branch_name.outputs.hashed}}
env:
GH_TOKEN: ${{ github.token }}
GH_REPOSITORY: ${{ github.repository }}
build-examples:
runs-on: ubuntu-latest
needs: build-libs
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Prepare
uses: ./.github/actions/prepare
- name: Download Build Information For Current Branch
uses: actions/download-artifact@v4
with:
name: ${{needs.build-libs.outputs.hashed_branch}}
- name: Build examples
uses: ./.github/actions/build-examples