Skip to content

Commit

Permalink
Merge pull request #2953 from Emurgo/release/4.16
Browse files Browse the repository at this point in the history
Release / 4.16
  • Loading branch information
vsubhuman authored Aug 15, 2022
2 parents 7202e13 + 845d04e commit 8691d3f
Show file tree
Hide file tree
Showing 46 changed files with 699 additions and 389 deletions.
110 changes: 88 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,25 @@ jobs:
- name: tests
run: |
npm run test
E2E_tests_dApp_Chrome:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check'))
runs-on: macos-11
E2E_tests_dApp:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check') || contains(github.event.review.body, '/dapp-check'))
runs-on: macos-12
strategy:
matrix:
browser: ['chrome', 'firefox']
fail-fast: false
steps:
- uses: actions/checkout@v2
- 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
Expand Down Expand Up @@ -97,33 +109,85 @@ jobs:
working-directory: ./packages/yoroi-extension
env:
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}
run: npm run test:run:e2e:dApp:chrome
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
path: ./packages/yoroi-extension/testRunsData

E2E_tests_dApp_FF:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check') || contains(github.event.review.body, '/run_dapp_ff'))
runs-on: macos-11
Trezor_Model_T_emulator:
if: github.event.review && (github.event.review.state == 'approved' || contains(github.event.review.body, '/check') || contains(github.event.review.body, '/trezor-check'))
runs-on: ubuntu-22.04
strategy:
matrix:
browser: [ 'chrome', 'firefox' ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Forcefully install Firefox for Developers browser
run: brew update && brew tap homebrew/cask-versions && brew install --cask firefox-developer-edition
- name: Set up env variable for FF
run: echo "FIREFOX_DEV=/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox-bin" >> $GITHUB_ENV
- 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
- name: Clone the trezor-usr-env
run: |
cd ..
git clone https://github.com/trezor/trezor-user-env.git
- name: Install nix-shell
run: |
sudo apt update
sudo apt -y install nix-bin
- name: Download firmware
working-directory: ../trezor-user-env/src/binaries/firmware/bin/
run: sudo ./download.sh

- name: Download trezord-go
working-directory: ../trezor-user-env/src/binaries/trezord-go/bin/
run: sudo ./download.sh

- name: Copy the v2-master firmware to the root of the project
working-directory: ../trezor-user-env
run: cp -rf src/binaries/firmware/bin/trezor-emu-core-v2-master ./

- name: Copy the trezord-go-v2.0.31 to the root of the project
working-directory: ../trezor-user-env
run: cp -rf src/binaries/trezord-go/bin/trezord-go-v2.0.31 ./

- name: Create the logs folder in the root of the trezor-user-env
working-directory: ../trezor-user-env
run: mkdir logs

- name: Run the trezor user environment
working-directory: ../trezor-user-env
run: sudo docker run -p 9001:9001 -p 9002:9002 -p 21326:21326 -p 127.0.0.1:21325:21326 -p 21324:21324 -v logs:/trezor-user-env/logs/screens -v trezor-emu-core-v2-master:/trezor-user-env/src/binaries/firmware/bin/user_downloaded -v trezord-go-v2.0.31:/trezor-user-env/src/binaries/trezord-go/bin -d emurgornd/trezor-user-env:latest

- uses: actions/checkout@v3

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

- 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 @@ -136,9 +200,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 @@ -151,24 +216,25 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Clean cache
run: npm cache clean -f
- name: npm install
run: |
. install-all.sh
- name: Build the test version
- name: Build the test version using emulators
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
- name: Run tests
working-directory: ./packages/yoroi-extension
env:
MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }}
run: npm run test:run:e2e:dApp:firefox
run: xvfb-run -a -e /dev/stdout -s "-screen 0 1920x1080x24" npm run test:run:e2e:trezor:${{ matrix.browser }}

- name: Archive tests screenshots and logs
if: ${{ failure() }}
uses: actions/upload-artifact@v3
Expand Down
Loading

0 comments on commit 8691d3f

Please sign in to comment.