-
Notifications
You must be signed in to change notification settings - Fork 1
177 lines (145 loc) · 5.22 KB
/
test-frontend.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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@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@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@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@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@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}