Skip to content

chore: [DX-3334] Add the Subresource Integrity attribute to Checkout files #1475

chore: [DX-3334] Add the Subresource Integrity attribute to Checkout files

chore: [DX-3334] Add the Subresource Integrity attribute to Checkout files #1475

Workflow file for this run

name: PR
on:
pull_request:
branches:
- main
merge_group:
branches:
- main
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.TS_IMMUTABLE_SDK_NX_TOKEN }}
jobs:
syncpack:
name: Syncpack
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Syncpack
run: yarn syncpack:check
build-lint-test-typecheck-sdk:
name: Build, Lint, Test & Typecheck SDK
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Build, Lint, Test & Typecheck
run: yarn nx affected -t build,lint,test,typecheck
- name: Validate Checkout Widgets Hashes
run: |
cd packages/checkout/widgets-lib
mv hashes.json hashes.json.old
yarn updateHashes
if [ -n "$(git diff --exit-code hashes.json)" ]; then
echo "Hashes.json has changed. Please update the hashes.json file and commit the changes."
echo "You can use the following command in the root of the repo to update the hashes.json file:"
echo "yarn workspace @imtbl/checkout-widgets updateHashes"
exit 1
fi
build-lint-test-examples:
name: Build, Lint & Test Examples
runs-on: ubuntu-latest-8-cores
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Prepare examples
run: yarn prepare:examples
- name: Build examples
run: yarn build:examples
- name: Lint examples
run: yarn lint:examples
- name: Setup playwright
uses: ./.github/actions/setup-playwright
- name: Prepare widgets bundle for Checkout Widgets example app
run: yarn workspace @imtbl/checkout-widgets prepare:examplewidgets
- name: Test examples
run: yarn test:examples
build-lint-test-example-widgets-with-sdk:
name: Build, Lint & Test Example Widgets with latest SDK
runs-on: ubuntu-latest-8-cores
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Setup playwright
uses: ./.github/actions/setup-playwright
- name: Install SDK at current version
run: yarn workspace @examples/sdk-load-widgets-with-nextjs add @imtbl/sdk@$(npm view @imtbl/sdk version)
- name: Build next app
run: yarn workspace @examples/sdk-load-widgets-with-nextjs build
- name: Build everything
run: yarn build
- name: Lint examples
run: yarn workspace @examples/sdk-load-widgets-with-nextjs lint
- name: Prepare widgets bundle for Checkout Widgets example app
run: yarn workspace @imtbl/checkout-widgets prepare:examplewidgets
- name: Test Widget example
run: yarn workspace @examples/sdk-load-widgets-with-nextjs test
func-tests:
name: Functional tests
runs-on: ubuntu-latest-8-cores
env:
# imx envs
NETWORK: sepolia
TEST_ALCHEMY_API_KEY: ${{ secrets.TEST_ALCHEMY_API_KEY }}
PUBLIC_API_URL: "https://api.sandbox.x.immutable.com/v1"
TEST_STARK_CONTRACT_ADDRESS: "0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98"
TEST_REGISTRATION_CONTRACT_ADDRESS: "0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97"
TEST_TOKEN_ADDRESS: "0xfA5539fBEd27887EEbb2515672D80412D1A3ADa3"
TEST_WALLET1_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_PRIVATE_KEY }}
TEST_WALLET1_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_STARK_PRIVATE_KEY }}
TEST_WALLET2_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_PRIVATE_KEY }}
TEST_WALLET2_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_STARK_PRIVATE_KEY }}
TEST_WALLET_BANKER_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_PRIVATE_KEY }}
TEST_WALLET_BANKER_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_STARK_PRIVATE_KEY }}
TEST_STARKEX_BATCH_SIZE: 500
# zkevm envs
ZKEVM_ORDERBOOK_BANKER: ${{ secrets.ZKEVM_ORDERBOOK_BANKER }}
ZKEVM_ORDERBOOK_ERC20: "0x70dCEF6C22F50497eafc77D252E8E175af21bF75"
ZKEVM_ORDERBOOK_ERC721: "0xBE8B131f39825282Ace9eFf99C0Bb14972417b49"
ZKEVM_ORDERBOOK_ERC1155: "0x2efB9B7810B1d1520c0822aa20F1889ABd2c2146"
SEAPORT_CONTRACT_ADDRESS: "0x7d117aA8BD6D31c4fa91722f246388f38ab1942c"
ZONE_CONTRACT_ADDRESS: "0x1004f9615E79462c711Ff05a386BdbA91a7628C3"
ZKEVM_RPC_ENDPOINT: "https://rpc.testnet.immutable.com"
ORDERBOOK_MR_API_URL: "https://api.sandbox.immutable.com"
ZKEVM_CHAIN_NAME: "imtbl-zkevm-testnet"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup
- name: Prepare tests
run: yarn prepare:tests
- name: Run functional tests
run: FORCE_COLOR=1 yarn workspaces foreach -Apt --include='@tests/**' run func-test:ci