Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into chore/firefox-support
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmain committed Jul 16, 2024
2 parents 788f20e + d4de8a7 commit d756aab
Show file tree
Hide file tree
Showing 1,653 changed files with 36,547 additions and 46,037 deletions.
5 changes: 2 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ module.exports = {
'no-invalid-this': 0,
'react/prop-types': 'off',
'max-len': 'off', // prettier is already handling this automatically,
// note: prod webpack config strips console logs anyway, nevertheless
// we don't want the dev build to be spammed by needless logging
'@typescript-eslint/no-explicit-any': ['error'],
'no-console': ['error', { allow: ['warn', 'error', 'info', 'debug'] }],
'lodash/import-scope': ['error', 'method']
'lodash/import-scope': ['error', 'method'],
'promise/avoid-new': 'off'
},
overrides: [
{
Expand Down
5 changes: 3 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Root Level
* @input-output-hk/lace-tech-leads
yarn.lock @input-output-hk/lace-core

# Packages Teams
/packages/cardano/ @input-output-hk/lace-core
/packages/common/ @input-output-hk/lace-core
/packages/core/ @input-output-hk/lace-core
/packages/e2e-tests/ @input-output-hk/lace-test-engineers
/packages/e2e-tests/ @input-output-hk/xsy-lace-test-engineers
/packages/staking/ @input-output-hk/lace-core
/packages/ui/ @input-output-hk/lace-core
/packages/translation/ @input-output-hk/lace-core

# Apps
/apps/ @input-output-hk/lace-core
30 changes: 30 additions & 0 deletions .github/actions/build/package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: build
description: Build package

inputs:
DIR:
description: 'package directory'
required: true
NAME:
description: 'package name'
required: true

runs:
using: 'composite'

steps:
- name: Code check
uses: ./.github/actions/check
with:
DIR: ${{ inputs.DIR }}

- name: Build ${{ inputs.NAME }}
run: yarn build
shell: bash
working-directory: ${{ inputs.DIR }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.NAME }}
path: ${{ inputs.DIR }}/dist
26 changes: 26 additions & 0 deletions .github/actions/check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: check
description: Code check

inputs:
DIR:
description: 'package directory'
required: true

runs:
using: 'composite'

steps:
- name: Format check
run: yarn format-check
shell: bash
working-directory: ${{ inputs.DIR }}

- name: Code check
run: yarn lint
shell: bash
working-directory: ${{ inputs.DIR }}

- name: Type check
run: yarn type-check
shell: bash
working-directory: ${{ inputs.DIR }}
42 changes: 42 additions & 0 deletions .github/actions/chromatic/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: deploy chromatic
description: Deploy storybook to Chromatic

inputs:
TOKEN:
description: 'Chromatic token'
required: true
DIR:
description: 'Package directory'
required: true
NAME:
description: 'Package name'
required: true

runs:
using: 'composite'

steps:
- name: Tests
working-directory: ./${{ inputs.DIR }}
run: yarn test-storybook:ci
shell: bash

- name: Publish to Chromatic
if: github.ref != 'refs/heads/main'
uses: chromaui/action@v1
with:
projectToken: ${{ inputs.TOKEN }}
workingDir: ./${{ inputs.DIR }}
buildScriptName: build-storybook
onlyChanged: true
exitOnceUploaded: true

- name: Publish to Chromatic and auto accept changes
if: github.ref == 'refs/heads/main'
uses: chromaui/action@v1
with:
projectToken: ${{ inputs.TOKEN }}
autoAcceptChanges: true
workingDir: ./${{ inputs.DIR }}
onlyChanged: true
exitOnceUploaded: true
47 changes: 47 additions & 0 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: setup and install
description: Setup Node.js and install dependencies

inputs:
WALLET_PASSWORD:
description: 'Test wallet password'
required: true
GITHUB_TOKEN:
description: 'GitHub Token'
required: true


runs:
using: 'composite'
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Configure Yarn to use GitHub Packages
run: |
echo "npmScopes:" >> ~/.yarnrc.yml
echo " input-output-hk:" >> ~/.yarnrc.yml
echo " npmRegistryServer: \"https://npm.pkg.github.com\"" >> ~/.yarnrc.yml
echo " npmAuthToken: \"${{ inputs.GITHUB_TOKEN }}\"" >> ~/.yarnrc.yml
shell: bash

- name: Node modules cache
uses: actions/cache@v4
with:
path: |
node_modules
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
run: yarn install --immutable --inline-builds
shell: bash

- name: Decrypt test data
working-directory: ./packages/e2e-tests
run: ./decrypt_secret.sh
shell: bash
env:
WALLET_1_PASSWORD: ${{ inputs.WALLET_PASSWORD }}
92 changes: 92 additions & 0 deletions .github/actions/test/e2e/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: e2e-split
description: Execute e2e regression split tests

inputs:
LACE_EXTENSION_KEY:
description: 'Public extended manifest key'
required: true
WALLET_PASSWORD:
description: 'Test wallet password'
required: true
TEST_DAPP_URL:
description: 'Test DApp Url'
required: true
GITHUB_TOKEN:
description: 'Github token'
required: true
BROWSER:
description: 'browser'
required: false
default: 'chrome'
DISPLAY:
description: ''
required: false
default: ':99.0'
BATCH:
description: 'Tests batch'
required: true
default: '1'
SMOKE_ONLY:
description: 'Run only smoke tests'
required: true
default: 'false'

runs:
using: 'composite'

steps:
- name: Start XVFB
shell: bash
env:
DISPLAY: ${{ inputs.DISPLAY }}
run: |
Xvfb :99 &
- name: Build dist version of Lace
uses: ./.github/shared/build
with:
LACE_EXTENSION_KEY: ${{ inputs.LACE_EXTENSION_KEY }}
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
- name: Decrypt test data
if: success()
working-directory: ./packages/e2e-tests
run: ./decrypt_secret.sh
shell: bash
env:
WALLET_1_PASSWORD: ${{ inputs.WALLET_PASSWORD }}
- name: Execute E2E tests
if: success()
shell: bash
id: e2e-tests
working-directory: ./packages/e2e-tests
env:
WALLET_1_PASSWORD: ${{ inputs.WALLET_PASSWORD }}
TEST_DAPP_URL: ${{ inputs.TEST_DAPP_URL }}
BROWSER: ${{ inputs.BROWSER }}
DISPLAY: ${{ inputs.DISPLAY }}
BATCH: ${{ inputs.BATCH }}
run: |
if [ "${{ inputs.SMOKE_ONLY }}" == "true" ]; then
runCommand="yarn wdio run wdio.conf.${BROWSER}.ts --suite batch${BATCH} --cucumberOpts.tags='@Smoke and @Testnet and not @Pending'"
else
runCommand="yarn wdio run wdio.conf.${BROWSER}.ts --suite batch${BATCH} --cucumberOpts.tags='@Testnet and not @Pending'"
fi
eval "$runCommand";
- name: Save dmesg logs
shell: bash
if: always()
working-directory: ./packages/e2e-tests
run: |
sudo dmesg > ./dmesg.log
- name: Publish artifacts (logs, reports, screenshots)
if: always()
uses: actions/upload-artifact@v4
env:
BATCH: ${{ inputs.BATCH }}
with:
name: runner-artifacts-${{ env.BATCH }}
path: |
./packages/e2e-tests/screenshots
./packages/e2e-tests/logs
./packages/e2e-tests/reports/allure/results
./packages/e2e-tests/dmesg.log
retention-days: 5
14 changes: 14 additions & 0 deletions .github/actions/test/unit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: unit
description: Execute unit tests

runs:
using: 'composite'

steps:
- name: Unit tests
run: yarn test
shell: bash
env:
AVAILABLE_CHAINS: 'Preprod,Preview,Mainnet'
DEFAULT_CHAIN: 'Preprod'
NODE_OPTIONS: '--max_old_space_size=8192'
3 changes: 0 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ staking:
- any: ['packages/staking/**/*']
- any: ['.github/workflows/packages-staking.yml']

# UI Toolkit
ui-toolkit:
- any: ['packages/ui/**/*']
# E2E
e2e:
- any: ['packages/e2e-tests/**/*']
Expand Down
15 changes: 9 additions & 6 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ labels:
description: Changes to the staking package.
color: '#685369'

- name: ui-toolkit
description: Changes to the ui package.
color: '#FFBF00'

- name: e2e
description: Changes to the e2e testing instrumentation.
color: '#0B4F6C'
Expand Down Expand Up @@ -91,9 +87,16 @@ branches:
strict: false
# Required. The list of status checks to require in order to merge into this branch
checks:
- context: Build & Test
- context: block-fixup
- context: Build Staking Center
- context: Prepare
- context: Unit tests
- context: Smoke tests
- context: >
Run Chromatic check: Core
- context: >
Run Chromatic check: Staking
- context: >
Run Chromatic check: UI
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
enforce_admins:
# Prevent merge commits from being pushed to matching branches
Expand Down
Loading

0 comments on commit d756aab

Please sign in to comment.