chore(sdk tests): add a few sdk tests #94
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: CI | |
on: | |
pull_request: | |
paths-ignore: | |
- 'packages/sdk-platforms/**' | |
workflow_dispatch: | |
jobs: | |
e2e-demo-app: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./ | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
submodules: recursive | |
# Start node | |
- name: Era Test Node Action | |
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.11.0 | |
- name: Use Node.js | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | |
with: | |
node-version: lts/Iron | |
cache: pnpm | |
# Install dependencies for repo | |
- name: Install dependencies | |
run: pnpm install -r --frozen-lockfile | |
# Install dependencies for the submodule | |
- name: Install contract dependencies | |
run: pnpm install -r --frozen-lockfile | |
working-directory: packages/contracts | |
- name: Build SDK | |
run: pnpm nx build sdk | |
- name: Build contracts | |
run: pnpm build | |
working-directory: packages/contracts | |
- name: Deploy contracts | |
run: pnpm run deploy | |
working-directory: packages/contracts | |
- name: Run tests | |
run: pnpm test | |
working-directory: packages/sdk | |
# Run E2E tests | |
- name: Install Playwright Chromium Browser | |
run: pnpm exec playwright install chromium | |
working-directory: examples/demo-app | |
- name: Run e2e tests | |
run: pnpm nx e2e demo-app | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: demo-app-playwright-report | |
path: examples/demo-app/playwright-report/ | |
retention-days: 3 | |
e2e-nft-quest: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./ | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
submodules: recursive | |
# Start node | |
- name: Era Test Node Action | |
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.11.0 | |
- name: Use Node.js | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | |
with: | |
node-version: lts/Iron | |
cache: pnpm | |
# Install dependencies for repo | |
- name: Install dependencies | |
run: pnpm install -r --frozen-lockfile | |
# Install dependencies for the submodule | |
- name: Install contract dependencies | |
run: pnpm install -r --frozen-lockfile | |
working-directory: packages/contracts | |
- name: Build SDK | |
run: pnpm nx build sdk | |
- name: Build contracts | |
run: pnpm build | |
working-directory: packages/contracts | |
- name: Deploy contracts | |
run: pnpm run deploy | |
working-directory: packages/contracts | |
- name: Deploy NFT contracts | |
run: pnpm nx deploy:local nft-quest-contracts | |
# Run E2E tests | |
- name: Install Playwright Chromium Browser | |
run: pnpm exec playwright install chromium | |
working-directory: examples/nft-quest | |
- name: Run e2e tests | |
run: pnpm nx e2e nft-quest | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: nft-quest-playwright-report | |
path: examples/nft-quest/playwright-report/ | |
retention-days: 3 | |
contracts: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./ | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
submodules: recursive | |
# Start node | |
- name: Era Test Node Action | |
uses: dutterbutter/era-test-node-action@36ffd2eefd46dc16e7e2a8e1715124400ec0a3ba # v1 | |
# Setup pnpm | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 9.11.0 | |
- name: Use Node.js | |
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4 | |
with: | |
node-version: lts/Iron | |
cache: pnpm | |
# Install dependencies for the submodule | |
- name: Install contract dependencies | |
run: pnpm install -r --frozen-lockfile | |
working-directory: packages/contracts | |
# Build contracts and generate types | |
- name: Build contracts | |
run: pnpm build | |
working-directory: packages/contracts | |
# Run contract tests | |
- name: Run contract test | |
run: pnpm test | |
working-directory: packages/contracts |