Skip to content

Commit

Permalink
chore: cleanup PR workflow (#2225)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaidarain1 committed Sep 25, 2024
1 parent c14e661 commit 7c9c219
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 122 deletions.
9 changes: 0 additions & 9 deletions .github/actions/setup-tests/action.yaml

This file was deleted.

128 changes: 15 additions & 113 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,108 +21,28 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: setup
uses: ./.github/actions/setup

- name: Syncpack
run: yarn syncpack:check

detect:
name: Detect Node engine version change
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get Node engine version from package.json
id: get_package_json_node_engine_version
run: |
node_engine_major_version=$(jq -r '.engines.node' ./sdk/package.json | sed 's/^>=//' | cut -d. -f1)
echo "::set-output name=node_engine_major_version::$node_engine_major_version"
- name: Get Node.js version from .nvmrc
id: get_nvmrc_node_version
run: echo "::set-output name=nvmrc_node_version::$(head -n 1 .nvmrc | cut -d. -f1)"

- name: Check Node.js engine version change
run: |
package_version_major=$(echo "${{ steps.get_package_json_node_engine_version.outputs.node_engine_major_version }}")
nvmrc_version_major=$(echo "${{ steps.get_nvmrc_node_version.outputs.nvmrc_node_version }}")
if [ "$package_version_major" != "$nvmrc_version_major" ]; then
echo "Node.js engine version has changed"
exit 1
else
echo "Node.js engine version has not changed"
fi
build-sdk:
name: Build SDK
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
run: yarn nx affected --target=build

typecheck-sdk:
name: Typecheck SDK
runs-on: ubuntu-latest-4-cores
needs: build-sdk
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: Typecheck
run: yarn typecheck

test-sdk:
name: Test SDK
runs-on: ubuntu-latest-8-cores
needs: build-sdk
env:
NODE_OPTIONS: --max-old-space-size=14366
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: Test
run: yarn test --configuration=ci

- name: Upload SDK test coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverages
path: ./packages/**/coverage/*

lint-sdk:
name: Lint SDK
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: Lint
run: yarn lint
- name: Build, Lint, Test & Typecheck
run: yarn nx affected -t build,lint,test,typecheck

build-lint-test-examples:
name: Build, Lint & Test Examples
Expand Down Expand Up @@ -152,11 +72,11 @@ jobs:
run: yarn test:examples


func-test-imx:
name: imx func tests
runs-on: ubuntu-latest-4-cores
needs: build-sdk
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"
Expand All @@ -170,26 +90,8 @@ jobs:
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
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: Setup tests
uses: ./.github/actions/setup-tests

- name: test
run: yarn workspace @tests/func-tests-imx func-test:ci

func-test-zkevm:
name: zkevm func tests
runs-on: ubuntu-latest-8-cores
needs: build-sdk
env:
# zkevm envs
ZKEVM_ORDERBOOK_BANKER: ${{ secrets.ZKEVM_ORDERBOOK_BANKER }}
ZKEVM_ORDERBOOK_ERC721: "0xBE8B131f39825282Ace9eFf99C0Bb14972417b49"
ZKEVM_ORDERBOOK_ERC1155: "0x2efB9B7810B1d1520c0822aa20F1889ABd2c2146"
Expand All @@ -204,12 +106,12 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: setup
uses: ./.github/actions/setup

- name: Setup tests
uses: ./.github/actions/setup-tests
- name: Prepare tests
run: yarn prepare:tests

- name: test
run: yarn workspace @tests/func-tests-zkevm func-test:ci
- name: Run functional tests
run: FORCE_COLOR=1 yarn workspaces foreach -Apt --include='@tests/**' run func-test:ci

0 comments on commit 7c9c219

Please sign in to comment.