Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CU-86a0jg60u - Setup CI/CD on WcSdk repository to check the build and the e2e tests on the pullrequest #84

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 0 additions & 86 deletions .circleci/config.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/check-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Check Build and Test
on:
pull_request:
branches:
- main

env:
NODE_VERSION: 16.x

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Setup Node Version ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install PNPM
run: npm install -g pnpm
- name: Install RushJS
run: npm install -g @microsoft/rush
- name: Install Yarn
run: npm install --global yarn
- name: Verify Change Logs
run: rush change --verify
- name: Install Dependencies
run: rush update
- name: Build Projects
run: rush rebuild --verbose
- name: Install Examples Dependencies
working-directory: ./examples
run: |
for dir in */; do
if [ -d "$dir" ]; then
(cd "$dir" && yarn install && yarn build && yarn playwright install)
fi
done
- name: Run E2E Tests
working-directory: ./examples
run: |
yarn global add serve
for dir in */; do
if [ -d "$dir" ]; then
(cd "$dir" && yarn test:e2e:headless)
fi
done

7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,10 @@ common/autoinstallers/*/.npmrc

# jetbrains
.idea

# Examples build
examples/*/build/
examples/*/dist/

# Examples test result
examples/*/test-results/
4 changes: 3 additions & 1 deletion examples/wc-dapp-react/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import type { PlaywrightTestConfig } from '@playwright/test'

const config: PlaywrightTestConfig = {
fullyParallel: true,
testMatch: '**/*.ts',
webServer: {
command: 'yarn start',
command: 'npx serve -s build',
port: 3000,
},
testDir: 'tests',
timeout: 4000
}

export default config
5 changes: 2 additions & 3 deletions examples/wc-dapp-vite-vanilla/playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@


const config = {
fullyParallel: true,
testMatch: '**/*.js',
webServer: {
command: 'yarn run build && yarn run preview',
command: 'yarn preview',
port: 4173,
},
testDir: 'tests',
Expand Down
2 changes: 1 addition & 1 deletion examples/wc-dapp-vite-vanilla/tests/walletConnect.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'

test('Dapp connect to wallet', async ({context, page}) => {
await page.goto('/') // Go home page
await page.waitForTimeout(500) // Await home to load
await page.waitForTimeout(750) // Await home to load
const [newPage] = await Promise.all([
context.waitForEvent('page'),
page.getByTestId('app__wallet-connect').click() // Click to connect
Expand Down
3 changes: 2 additions & 1 deletion examples/wc-wallet-react/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { PlaywrightTestConfig } from '@playwright/test'

const config: PlaywrightTestConfig = {
fullyParallel: true,
testMatch: '**/*.ts',
webServer: {
command: 'yarn start',
command: 'npx serve -s build',
port: 3000,
},
testDir: 'tests',
Expand Down