diff --git a/.github/workflows/lint-format.yml b/.github/workflows/lint-format.yml index 2b340900..ee054a7c 100644 --- a/.github/workflows/lint-format.yml +++ b/.github/workflows/lint-format.yml @@ -6,19 +6,32 @@ on: branches: - main +permissions: + contents: read + pull-requests: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: lint-format: runs-on: ubuntu-latest - steps: - name: Checkout repository uses: actions/checkout@v4 + with: + persist-credentials: false - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: "20.x" - cache: "yarn" + node-version: "20" + cache: yarn + cache-dependency-path: "yarn.lock" + + - name: Ensure Yarn v1.22+ + run: npm i -g yarn@^1.22.0 && yarn --version - name: Install dependencies run: yarn install --frozen-lockfile @@ -29,5 +42,45 @@ jobs: - name: Run Lint-Staged (Prettier & ESLint) run: yarn lint-staged + - name: Run lint:check + run: yarn lint:check + - name: Run Commitlint on Last Commit + if: github.event_name == 'pull_request' run: git log -1 --pretty=format:%s | npx --no -- commitlint + + e2e-web: + name: Web E2E (headless) + runs-on: ubuntu-latest + needs: lint-format + if: github.event_name == 'pull_request' && (github.event.action == 'ready_for_review' || github.event.action == 'opened' || github.event.action == 'synchronize') + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: yarn + cache-dependency-path: "yarn.lock" + + - name: Ensure Yarn v1.22+ + run: npm i -g yarn@^1.22.0 && yarn --version + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Cache Cypress binary + uses: actions/cache@v4 + with: + path: ~/.cache/Cypress + key: cypress-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + + - name: Run Web E2E Tests + run: yarn workspace web cy:e2e-headless + env: + CYPRESS_CACHE_FOLDER: ~/.cache/Cypress + CI: true diff --git a/README.md b/README.md index 610dfcfa..9d2d688d 100644 --- a/README.md +++ b/README.md @@ -71,14 +71,15 @@ yarn cypress-e2e-headless-test ### ๐Ÿš€ Overview -Added comprehensive end-to-end testing using **WebdriverIO** for the wallet application, covering: +Added comprehensive end-to-end testing using **WebdriverIO** for the wallet +application, covering: - * โœ… **Login flow** (success & failure cases) - * โœ… **Wallet creation** process - * โœ… **User registration** workflow - * and more +- โœ… **Login flow** (success & failure cases) +- โœ… **Wallet creation** process +- โœ… **User registration** workflow +- and more ------ +--- ### ๐Ÿงช Test Commands @@ -100,7 +101,7 @@ yarn bdd:e2e:debug yarn bdd:e2e:update-driver ``` ------ +--- ### ๐Ÿ–ผ๏ธ Test Evidence @@ -115,17 +116,17 @@ $ yarn test:e2e [chrome] โœ” Registration - Email signup (5.8s) ``` ------ +--- ### โœ… Verification Checklist - * All tests pass locally (`yarn test:e2e`) - * No production code modified - * Test data follows PII guidelines - * ChromeDriver version (v136) matches CI - * Documentation updated if needed +- All tests pass locally (`yarn test:e2e`) +- No production code modified +- Test data follows PII guidelines +- ChromeDriver version (v136) matches CI +- Documentation updated if needed ------ +--- ### โš ๏ธ Requirements @@ -137,8 +138,6 @@ yarn workspace web dev Also, ensure you have Chrome v136+ installed. - - ## ๐Ÿ—๏ธ Project Structure ``` @@ -227,13 +226,14 @@ yarn test # Lint and format yarn lint:fix ``` + ## How to set up: lint, code format, Typescript for a new package/app -Follow this PR too add shared configuration package to standardize linting, formatting, and TypeScript setup across the project. +Follow this PR too add shared configuration package to standardize linting, +formatting, and TypeScript setup across the project. https://github.com/Greenstand/treetracker-wallet-app/pull/537/files - ## ๐Ÿค Contributing We welcome contributions! Whether you're fixing bugs, adding features, or