Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into Ahmed/add-tx-receiver
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/yoroi-connector/example-cardano/index.js
  • Loading branch information
vsubhuman committed Jan 31, 2023
2 parents eae1fdc + 8bf73a8 commit 7a73f8d
Show file tree
Hide file tree
Showing 65 changed files with 760 additions and 1,028 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: SonarQube Checks

on:
# Trigger analysis when pushing to your main branches, and when creating a pull request.
push:
branches:
- main
- master
- develop
- 'releases/**'
pull_request:
types: [opened, synchronize, reopened]

jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
154 changes: 135 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ jobs:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check') || contains(github.event.review.body, '/release-check'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-yoroi-extension-node-modules
with:
Expand All @@ -32,9 +35,11 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: npm install
run: |
. install-all.sh
- name: tests
run: |
npm run test
Expand All @@ -46,27 +51,33 @@ jobs:
matrix:
browser: ['chrome', 'firefox']
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Forcefully update the Chrome browser
if: matrix.browser=='chrome'
run: brew update && brew upgrade --cask google-chrome

- name: Forcefully install Firefox for Developers browser
if: matrix.browser=='firefox'
run: |
brew update
brew tap homebrew/cask-versions && brew install --cask firefox-developer-edition
echo "FIREFOX_DEV=/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox-bin" >> $GITHUB_ENV
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache extension node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-yoroi-extension-node-modules
with:
Expand All @@ -79,9 +90,10 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache connector node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-yoroi-connector-node-modules
with:
Expand All @@ -94,27 +106,32 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: npm install
run: |
. install-all.sh
- name: Build the test version
working-directory: ./packages/yoroi-extension
run: npm run test:build

- name: Create the report's folder
working-directory: ./packages/yoroi-extension
run: |
mkdir reports
touch ./reports/cucumberReports.json
- name: Run dapp connector tests
working-directory: ./packages/yoroi-extension
env:
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}
run: npm run test:run:e2e:dApp:${{ matrix.browser }}

- name: Archive tests screenshots and logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: testRunsData_${{ matrix.browser }}
name: testRunsData_E2E_tests_dApp_${{ matrix.browser }}
path: ./packages/yoroi-extension/testRunsData_${{ matrix.browser }}

Trezor_Model_T_emulator:
Expand All @@ -124,6 +141,7 @@ jobs:
matrix:
browser: ['chrome', 'firefox']
fail-fast: false

steps:
- name: Forcefully update the Chrome browser
if: matrix.browser=='chrome'
Expand Down Expand Up @@ -178,13 +196,14 @@ jobs:
- uses: actions/checkout@v3

- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache extension node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v3
Expand Down Expand Up @@ -221,7 +240,7 @@ jobs:
run: |
. install-all.sh
- name: Build the test version using emulators
- name: Build the test version
working-directory: ./packages/yoroi-extension
run: npm run test:build

Expand All @@ -239,7 +258,7 @@ jobs:
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: testRunsData_${{ matrix.browser }}
name: testRunsData_Trezor_Model_T_emulator_${{ matrix.browser }}
path: ./packages/yoroi-extension/testRunsData_${{ matrix.browser }}

E2E_smoke_tests:
Expand All @@ -249,8 +268,10 @@ jobs:
matrix:
browser: ['chrome', 'firefox']
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Forcefully update the Chrome browser
if: matrix.browser=='chrome'
run: |
Expand All @@ -268,17 +289,17 @@ jobs:
echo "FIREFOX_DEV=/opt/firefoxdev/firefox-bin" >> $GITHUB_ENV
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache extension node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-yoroi-extension-node-modules
with:
Expand All @@ -294,7 +315,7 @@ jobs:
- name: Cache connector node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v2
uses: actions/cache@v3
env:
cache-name: cache-yoroi-connector-node-modules
with:
Expand Down Expand Up @@ -334,5 +355,100 @@ jobs:
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: testRunsData_${{ matrix.browser }}
name: testRunsData_E2E_smoke_tests_${{ matrix.browser }}
path: ./packages/yoroi-extension/testRunsData_${{ matrix.browser }}

E2E_regression_tests:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check') || contains(github.event.review.body, '/regression-check'))
runs-on: ubuntu-22.04
strategy:
matrix:
browser: [ 'chrome', 'firefox' ]
fail-fast: false

steps:
- name: Forcefully update the Chrome browser
if: matrix.browser=='chrome'
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
- name: Install Firefox Developer Edition
if: matrix.browser=='firefox'
run: |
wget -c "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US" -O - | sudo tar -xj -C /opt
sudo rm -rf /opt/firefoxdev
sudo mv /opt/firefox /opt/firefoxdev
echo "FIREFOX_DEV=/opt/firefoxdev/firefox-bin" >> $GITHUB_ENV
- uses: actions/checkout@v3

- name: Read .nvmrc
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache extension node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v3
env:
cache-name: cache-yoroi-extension-node-modules
with:
# https://github.com/actions/cache/blob/main/examples.md#node---npm
# It is recommended to cache the NPM cache (~/.npm) instead of node_modules.
# But we put node version into the cache key and cache node_modules.
path: packages/yoroi-extension/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-node-${{ steps.nvm.outputs.NVMRC }}-${{ hashFiles('packages/yoroi-extension/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache connector node modules
# https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
uses: actions/cache@v3
env:
cache-name: cache-yoroi-connector-node-modules
with:
# https://github.com/actions/cache/blob/main/examples.md#node---npm
# It is recommended to cache the NPM cache (~/.npm) instead of node_modules.
# But we put node version into the cache key and cache node_modules.
path: packages/yoroi-ergo-connector/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-node-${{ steps.nvm.outputs.NVMRC }}-${{ hashFiles('packages/yoroi-ergo-connector/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: npm install
run: |
. install-all.sh
- name: Build the test version
working-directory: ./packages/yoroi-extension
run: npm run test:build

- name: Create the report's folder
working-directory: ./packages/yoroi-extension
run: |
mkdir reports
touch ./reports/cucumberReports.json
- name: Run tests
working-directory: ./packages/yoroi-extension
env:
MAILSAC_API_KEY: ${{secrets.MAILSAC_API_KEY}}
run: xvfb-run -a -e /dev/stdout -s "-screen 0 1920x1080x24" npm run test:run:e2e:${{ matrix.browser }}

- name: Archive tests screenshots and logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: testRunsData_E2E_regression_tests_${{ matrix.browser }}
path: ./packages/yoroi-extension/testRunsData_${{ matrix.browser }}
4 changes: 3 additions & 1 deletion packages/yoroi-connector/example-cardano/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ function renderJonsResponse(title, response) {
);
}

window.onload = () => {
const onload = () => {
if (typeof window.cardano === "undefined") {
alertError("Cardano API not found");
} else {
Expand All @@ -1091,3 +1091,5 @@ window.onload = () => {
);
}
};

setTimeout(onload, 100);
12 changes: 10 additions & 2 deletions packages/yoroi-extension/app/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ export const Routes = (
)
)}
/>

<Route
path={ROUTES.NFTS.ROOT}
component={(props) => (
Expand All @@ -237,7 +236,6 @@ export const Routes = (
)
)}
/>

<Route
exact
path={ROUTES.WALLETS.ADD}
Expand Down Expand Up @@ -300,6 +298,11 @@ export const Routes = (
path={ROUTES.SWITCH}
component={(props) => <WalletSwitch {...props} stores={stores} actions={actions} />}
/>
<Route
exact
path={ROUTES.REVAMP.CATALYST_VOTING}
component={(props) => <VotingPage {...props} stores={stores} actions={actions} />}
/>
<Redirect to={ROUTES.MY_WALLETS} />
</Switch>
</Suspense>
Expand Down Expand Up @@ -352,6 +355,11 @@ const WalletsSubpages = (stores, actions) => (
path={ROUTES.WALLETS.CATALYST_VOTING}
component={(props) => <VotingPage {...props} stores={stores} actions={actions} />}
/>
<Route
exact
path={ROUTES.REVAMP.TRANSFER}
component={(props) => <Transfer {...props} stores={stores} actions={actions} />}
/>
</Switch>
);

Expand Down
Loading

0 comments on commit 7a73f8d

Please sign in to comment.