Skip to content

feat: update AppAutoComplete behaviour #1068

feat: update AppAutoComplete behaviour

feat: update AppAutoComplete behaviour #1068

name: Test Frontend
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
defaults:
run:
shell: bash
permissions:
contents: read
concurrency:
group: pr-checks-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Build | Front-end
runs-on: transaction-tools-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
front-end/pnpm-lock.yaml
- name: Install pnpm
run: npm install -g pnpm
- name: Install front-end dependencies
run: pnpm install --frozen-lockfile
working-directory: front-end
- name: Build Linux executable
run: pnpm run build:linux
working-directory: front-end
- name: Cache Build Artifacts
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: front-end/release/linux-unpacked
key: build-artifacts-${{ github.sha }}
test:
name: Automation | ${{ matrix.test-suite.name }}
runs-on: transaction-tools-linux-medium
needs: build
strategy:
fail-fast: false
matrix:
test-suite:
- name: Registration
command: RegistrationTests
- name: Login
command: LoginTests
- name: Settings
command: SettingsTests
- name: Transactions
command: TransactionTests
- name: Workflow
command: WorkflowTests
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
automation/pnpm-lock.yaml
- name: Install pnpm
run: npm install -g pnpm
- name: Install Docker Compose Plugin
run: |
sudo curl -fLo /usr/local/lib/docker/cli-plugins/docker-compose https://github.com/docker/compose/releases/download/v2.29.1/docker-compose-linux-x86_64
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
- name: Install automation dependencies
run: pnpm install --frozen-lockfile
working-directory: automation
- name: Install hedera globally
run: npm i -g @hashgraph/hedera-local
- name: run hedera local
run: hedera start -d --verbose=trace
- name: Restore Build Artifacts
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
fail-on-cache-miss: true
path: front-end/release/linux-unpacked
key: build-artifacts-${{ github.sha }}
- name: Install xvfb
run: sudo apt-get update && sudo apt-get install -y xvfb
- name: Install runtime shared libraries
run: sudo apt-get install --no-install-recommends -y xorg openbox libnss3 libasound2 libatk-adaptor libgtk-3-0
- name: run automation
env:
EXECUTABLE_PATH: ../front-end/release/linux-unpacked/hedera-transaction-tool
PRIVATE_KEY: "0x9a07bbdbb62e24686d2a4259dc88e38438e2c7a1ba167b147ad30ac540b0a3cd"
ENVIRONMENT: LOCALNET
run: xvfb-run -a npx playwright test tests/${{ matrix.test-suite.command }}
working-directory: automation
unit-test:
name: Unit Tests | ${{ matrix.test-suite.name }}
runs-on: transaction-tools-linux-medium
strategy:
fail-fast: false
matrix:
test-suite:
- name: Main Process
command: main
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: "npm"
cache-dependency-path: |
front-end/pnpm-lock.yaml
- name: Install pnpm
run: npm install -g pnpm
- name: Install front-end dependencies
run: pnpm install --frozen-lockfile
working-directory: front-end
- name: Run unit tests
run: pnpm run test:${{ matrix.test-suite.command }}:coverage
working-directory: front-end
- name: Upload coverage to Codecov
uses: codecov/codecov-action@968872560f81e7bdde9272853e65f2507c0eca7c # v5.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}