Skip to content

Commit cbf43f9

Browse files
ci: rework ci LW-10413 (#1097)
* ci: rework ci LW-10413 * ci: configure translation package * chore: staking disable source map * ci: update repository settings
1 parent 7b2c88f commit cbf43f9

34 files changed

+1698
-687
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Root Level
22
* @input-output-hk/lace-tech-leads
33
yarn.lock @input-output-hk/lace-core
4+
45
# Packages Teams
56
/packages/cardano/ @input-output-hk/lace-core
67
/packages/common/ @input-output-hk/lace-core
78
/packages/core/ @input-output-hk/lace-core
89
/packages/e2e-tests/ @input-output-hk/lace-test-engineers
10+
/packages/icons/ @input-output-hk/lace-core
911
/packages/staking/ @input-output-hk/lace-core
1012
/packages/ui/ @input-output-hk/lace-core
1113

.github/actions/build/app/action.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: buildapp
2+
description: Build app
3+
4+
inputs:
5+
DIR:
6+
description: 'app directory'
7+
required: true
8+
NAME:
9+
description: 'app name'
10+
required: true
11+
LACE_EXTENSION_KEY:
12+
description: 'Public extended manifest key'
13+
required: true
14+
BUILD_DEV_PREVIEW:
15+
description: 'Build developer preview of Lace'
16+
required: false
17+
default: 'false'
18+
POSTHOG_PRODUCTION_TOKEN_MAINNET:
19+
description: 'Post hog production mainnet token'
20+
required: false
21+
default: ''
22+
POSTHOG_PRODUCTION_TOKEN_PREPROD:
23+
description: 'Post hog production preprod token'
24+
required: false
25+
default: ''
26+
POSTHOG_PRODUCTION_TOKEN_PREVIEW:
27+
description: 'Post hog production preview token'
28+
required: false
29+
default: ''
30+
PRODUCTION_MODE_TRACKING:
31+
description: 'Enable analytics tracking in production'
32+
required: false
33+
default: 'false'
34+
35+
runs:
36+
using: 'composite'
37+
38+
steps:
39+
- name: Code check
40+
uses: ./.github/actions/check
41+
with:
42+
DIR: ${{ inputs.DIR }}
43+
44+
- name: Build ${{ inputs.NAME }}
45+
run: yarn build
46+
shell: bash
47+
working-directory: ${{ inputs.DIR }}
48+
env:
49+
LACE_EXTENSION_KEY: ${{ inputs.LACE_EXTENSION_KEY }}
50+
BUILD_DEV_PREVIEW: ${{ inputs.BUILD_DEV_PREVIEW }}
51+
POSTHOG_PRODUCTION_TOKEN_MAINNET: ${{ inputs.POSTHOG_PRODUCTION_TOKEN_MAINNET }}
52+
POSTHOG_PRODUCTION_TOKEN_PREPROD: ${{ inputs.POSTHOG_PRODUCTION_TOKEN_PREPROD }}
53+
POSTHOG_PRODUCTION_TOKEN_PREVIEW: ${{ inputs.POSTHOG_PRODUCTION_TOKEN_PREVIEW }}
54+
PRODUCTION_MODE_TRACKING: ${{ inputs.PRODUCTION_MODE_TRACKING }}
55+
56+
- name: Upload artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: ${{ inputs.NAME }}
60+
path: ${{ inputs.DIR }}/dist
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: build
2+
description: Build package
3+
4+
inputs:
5+
DIR:
6+
description: 'package directory'
7+
required: true
8+
NAME:
9+
description: 'package name'
10+
required: true
11+
12+
runs:
13+
using: 'composite'
14+
15+
steps:
16+
- name: Code check
17+
uses: ./.github/actions/check
18+
with:
19+
DIR: ${{ inputs.DIR }}
20+
21+
- name: Build ${{ inputs.NAME }}
22+
run: yarn build
23+
shell: bash
24+
working-directory: ${{ inputs.DIR }}
25+
26+
- name: Upload artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: ${{ inputs.NAME }}
30+
path: ${{ inputs.DIR }}/dist

.github/actions/check/action.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: check
2+
description: Code check
3+
4+
inputs:
5+
DIR:
6+
description: 'package directory'
7+
required: true
8+
9+
runs:
10+
using: 'composite'
11+
12+
steps:
13+
- name: Format check
14+
run: yarn format-check
15+
shell: bash
16+
working-directory: ${{ inputs.DIR }}
17+
18+
- name: Code check
19+
run: yarn lint
20+
shell: bash
21+
working-directory: ${{ inputs.DIR }}
22+
23+
- name: Type check
24+
run: yarn type-check
25+
shell: bash
26+
working-directory: ${{ inputs.DIR }}

.github/actions/chromatic/action.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: deploy chromatic
2+
description: Deploy storybook to Chromatic
3+
4+
inputs:
5+
TOKEN:
6+
description: 'Chromatic token'
7+
required: true
8+
DIR:
9+
description: 'Package directory'
10+
required: true
11+
NAME:
12+
description: 'Package name'
13+
required: true
14+
15+
runs:
16+
using: 'composite'
17+
18+
steps:
19+
- name: Tests
20+
working-directory: ./${{ inputs.DIR }}
21+
run: yarn test-storybook:ci
22+
shell: bash
23+
24+
- name: Publish to Chromatic
25+
if: github.ref != 'refs/heads/main'
26+
uses: chromaui/action@v1
27+
with:
28+
projectToken: ${{ inputs.TOKEN }}
29+
workingDir: ./${{ inputs.DIR }}
30+
buildScriptName: build-storybook
31+
onlyChanged: true
32+
exitOnceUploaded: true
33+
34+
- name: Publish to Chromatic and auto accept changes
35+
if: github.ref == 'refs/heads/main'
36+
uses: chromaui/action@v1
37+
with:
38+
projectToken: ${{ inputs.TOKEN }}
39+
autoAcceptChanges: true
40+
workingDir: ./${{ inputs.DIR }}
41+
onlyChanged: true
42+
exitOnceUploaded: true

.github/actions/install/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: setup and install
2+
description: Setup Node.js and install dependencies
3+
4+
inputs:
5+
WALLET_PASSWORD:
6+
description: 'Test wallet password'
7+
required: true
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Setup Node.js
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version-file: '.nvmrc'
16+
cache: 'yarn'
17+
18+
- name: Node modules cache
19+
uses: actions/cache@v4
20+
with:
21+
path: |
22+
node_modules
23+
**/node_modules
24+
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
25+
26+
- name: Install dependencies
27+
run: yarn install --immutable --inline-builds
28+
shell: bash
29+
30+
- name: Decrypt test data
31+
working-directory: ./packages/e2e-tests
32+
run: ./decrypt_secret.sh
33+
shell: bash
34+
env:
35+
WALLET_1_PASSWORD: ${{ inputs.WALLET_PASSWORD }}

.github/actions/test/smoke/action.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
name: smoke
2+
description: Execute e2e smoke tests
3+
4+
inputs:
5+
WALLET_PASSWORD:
6+
description: 'Test wallet password'
7+
required: true
8+
9+
TEST_DAPP_URL:
10+
description: 'Test DApp Url'
11+
required: true
12+
13+
GITHUB_TOKEN:
14+
description: 'Github token'
15+
required: true
16+
17+
E2E_AWS_ACCESS_KEY_ID:
18+
description: 'AWS access key id'
19+
required: true
20+
21+
E2E_AWS_SECRET_ACCESS_KEY:
22+
description: 'AWS secret access key'
23+
required: true
24+
25+
E2E_REPORTS_USER:
26+
description: 'E2E reports user'
27+
required: true
28+
29+
E2E_REPORTS_PASSWORD:
30+
description: 'E2E reports password'
31+
required: true
32+
33+
E2E_REPORTS_URL:
34+
description: 'E2E reports url'
35+
required: true
36+
37+
RUN:
38+
description: 'Runner number'
39+
required: true
40+
41+
BRANCH:
42+
description: 'Branch'
43+
required: true
44+
45+
TAGS:
46+
description: 'tags'
47+
required: false
48+
default: '@Smoke and @Testnet'
49+
50+
BROWSER:
51+
description: 'browser'
52+
required: false
53+
default: 'chrome'
54+
55+
DISPLAY:
56+
description: ''
57+
required: false
58+
default: ':99.0'
59+
60+
runs:
61+
using: 'composite'
62+
63+
steps:
64+
- name: Start XVFB
65+
shell: bash
66+
env:
67+
DISPLAY: ${{ inputs.DISPLAY }}
68+
run: |
69+
Xvfb :99 &
70+
71+
- name: Execute e2e smoke tests
72+
shell: bash
73+
id: e2e-tests
74+
working-directory: ./packages/e2e-tests
75+
env:
76+
WALLET_1_PASSWORD: ${{ inputs.WALLET_PASSWORD }}
77+
TEST_DAPP_URL: ${{ inputs.TEST_DAPP_URL }}
78+
TAGS: ${{ inputs.TAGS }}
79+
BROWSER: ${{ inputs.BROWSER }}
80+
RUN: ${{ inputs.RUN }}
81+
DISPLAY: ${{ inputs.DISPLAY }}
82+
BRANCH: ${{ inputs.BRANCH }}
83+
run: yarn wdio run wdio.conf.${{ inputs.BROWSER }}.ts --cucumberOpts.tags="@Smoke and not @Pending"
84+
85+
- name: Create allure properties
86+
shell: bash
87+
if: always()
88+
working-directory: ./packages/e2e-tests/reports/allure/results
89+
run: |
90+
echo "
91+
branch=${{ inputs.BRANCH }}
92+
browser=${{ inputs.BROWSER }}
93+
tags=${{ inputs.TAGS }}
94+
platform=Linux
95+
" > environment.properties
96+
97+
- name: Publish allure report to S3
98+
uses: andrcuns/allure-publish-action@v2.6.0
99+
if: always()
100+
env:
101+
GITHUB_AUTH_TOKEN: ${{ inputs.GITHUB_TOKEN }}
102+
AWS_ACCESS_KEY_ID: ${{ inputs.E2E_AWS_ACCESS_KEY_ID }}
103+
AWS_SECRET_ACCESS_KEY: ${{ inputs.E2E_AWS_SECRET_ACCESS_KEY }}
104+
with:
105+
storageType: s3
106+
resultsGlob: './packages/e2e-tests/reports/allure/results'
107+
bucket: lace-e2e-test-results
108+
prefix: 'smoke/linux/${{ inputs.BROWSER }}/${{ inputs.RUN }}'
109+
copyLatest: true
110+
ignoreMissingResults: true
111+
updatePr: comment
112+
baseUrl: 'https://${{ inputs.E2E_REPORTS_USER }}:${{ inputs.E2E_REPORTS_PASSWORD }}@${{ inputs.E2E_REPORTS_URL }}'
113+
114+
- name: Publish artifacts (logs, reports, screenshots)
115+
uses: actions/upload-artifact@v4
116+
if: always()
117+
with:
118+
name: test-artifacts
119+
path: |
120+
./packages/e2e-tests/screenshots
121+
./packages/e2e-tests/logs
122+
./packages/e2e-tests/reports
123+
retention-days: 5

.github/actions/test/unit/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: unit
2+
description: Execute unit tests
3+
4+
runs:
5+
using: 'composite'
6+
7+
steps:
8+
- name: Unit tests
9+
run: yarn test
10+
shell: bash
11+
env:
12+
AVAILABLE_CHAINS: 'Preprod,Preview,Mainnet'
13+
DEFAULT_CHAIN: 'Preprod'
14+
NODE_OPTIONS: '--max_old_space_size=8192'

.github/settings.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,13 @@ branches:
9191
strict: false
9292
# Required. The list of status checks to require in order to merge into this branch
9393
checks:
94-
- context: Build & Test
9594
- context: block-fixup
96-
- context: Build Staking Center
95+
- context: Prepare
96+
- context: Unit tests
97+
- context: Smoke tests
98+
- context: Chromatic Core
99+
- context: Chromatic Staking
100+
- context: Chromatic UI
97101
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
98102
enforce_admins:
99103
# Prevent merge commits from being pushed to matching branches

0 commit comments

Comments
 (0)