fix: error handling try statements #1391
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: 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@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
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@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
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@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
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@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | |
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@5c47607acb93fed5485fdbf7232e8a31425f672a # v5.0.2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |