chore: [DX-2673] - use nx to speed up builds #8985
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
name: Build, Lint, Typecheck, Test | |
on: | |
pull_request: | |
branches: | |
- main | |
merge_group: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest-4-cores | |
env: | |
NODE_OPTIONS: --max-old-space-size=14366 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
registry-url: https://registry.npmjs.org/ | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Check Single Package Version Policy | |
run: yarn syncpack:check | |
- name: Build | |
run: yarn bootstrap && yarn nx build @imtbl/sdk | |
- name: Typecheck | |
run: yarn typecheck | |
- name: Build passport sample app | |
run: yarn workspace @imtbl/passport-sdk-sample-app build | |
test: | |
name: Test | |
runs-on: ubuntu-latest-4-cores | |
env: | |
NODE_OPTIONS: --max-old-space-size=14366 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
registry-url: https://registry.npmjs.org/ | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Build | |
run: yarn bootstrap && yarn nx build @imtbl/sdk | |
- name: Test | |
run: yarn test | |
- name: Get reviewing teams | |
id: reviewer-teams | |
run: echo "teams=${{ join(github.event.pull_request.requested_teams.*.name, ', ') }}" >> $GITHUB_OUTPUT | |
- name: Checkout SDK test coverage | |
if: ${{ contains(steps.reviewer-teams.outputs.teams, 'Wallets')}} | |
run: yarn test:checkout:sdk:coverage | |
- name: Upload Checkout SDK test coverage artifacts | |
if: ${{ contains(steps.reviewer-teams.outputs.teams, 'Wallets')}} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: checkout-sdk-coverage-report | |
path: ./packages/checkout/sdk/coverage | |
cypress: | |
name: Cypress | |
runs-on: ubuntu-latest-4-cores | |
env: | |
NODE_OPTIONS: --max-old-space-size=14366 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
registry-url: https://registry.npmjs.org/ | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Get reviewing teams | |
id: reviewer-teams | |
run: echo "teams=${{ join(github.event.pull_request.requested_teams.*.name, ', ') }}" >> $GITHUB_OUTPUT | |
- name: Build | |
if: ${{ contains(steps.reviewer-teams.outputs.teams, 'Wallets') && !contains(github.event.pull_request.title, 'SKIP-CY') }} | |
run: yarn build | |
- name: Checkout-widgets cypress tests | |
if: ${{ contains(steps.reviewer-teams.outputs.teams, 'Wallets') && !contains(github.event.pull_request.title, 'SKIP-CY') }} | |
working-directory: ./packages/checkout/widgets-lib | |
run: yarn test:checkout:cypress | |
- name: Upload cypress videos artifacts | |
if: ${{ contains(steps.reviewer-teams.outputs.teams, 'Wallets') && !contains(github.event.pull_request.title, 'SKIP-CY') }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: checkout-widgets-cypress-videos | |
path: ./packages/checkout/widgets-lib/cypress/videos | |
- name: Upload cypress screenshots artifacts | |
uses: actions/upload-artifact@v2 | |
if: failure() | |
with: | |
name: checkout-widgets-cypress-screenshots | |
path: ./packages/checkout/widgets-lib/cypress/screenshots | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest-4-cores | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
registry-url: https://registry.npmjs.org/ | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Lint | |
run: yarn lint |