name: Cypress tests on: push: branches: - master - develop pull_request: jobs: master: name: Run end-to-end tests - main runs-on: ubuntu-latest strategy: matrix: vegawallet-version: - '0.13.2' if: ${{ github.event_name != 'pull_request' }} steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@v2 with: main-branch-name: master - name: Use Node.js 16 id: Node uses: actions/setup-node@v2 with: node-version: 16.14.0 - name: Install root dependencies run: yarn install - name: Download and unzip wallet run: curl -L https://github.com/vegaprotocol/vegawallet/releases/download/v${{ matrix.vegawallet-version }}/vegawallet-linux-amd64.zip -O - name: Unzip wallet run: unzip ./vegawallet-linux-amd64.zip - name: Create passphrase run: echo "${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}" > ./passphrase - name: Create recovery run: echo "${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}" > ./recovery - name: Initialize wallet run: ./vegawallet init -f - name: Import wallet run: ./vegawallet import -w UI_Trading_Test --recovery-phrase-file ./recovery -p ./passphrase - name: Import config run: ./vegawallet network import --from-url https://raw.githubusercontent.com/vegaprotocol/networks/master/fairground/fairground.toml - name: Create public key 2 run: ./vegawallet key generate -w UI_Trading_Test -p ./passphrase - name: Start service run: ./vegawallet service run --network fairground & - name: Run Cypress tests env: CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }} CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }} run: npx nx affected:e2e --parallel=5 --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome pr: name: Run end-to-end tests - PR runs-on: ubuntu-latest strategy: matrix: vegawallet-version: - '0.13.2' if: ${{ github.event_name == 'pull_request' }} steps: - name: Checkout uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 - name: Derive appropriate SHAs for base and head for `nx affected` commands uses: nrwl/nx-set-shas@v2 with: main-branch-name: master - name: Use Node.js 16 id: Node uses: actions/setup-node@v2 with: node-version: 16.14.0 - name: Install root dependencies run: yarn install - name: Download and unzip wallet run: curl -L https://github.com/vegaprotocol/vegawallet/releases/download/v${{ matrix.vegawallet-version }}/vegawallet-linux-amd64.zip -O - name: Unzip wallet run: unzip ./vegawallet-linux-amd64.zip - name: Create passphrase run: echo "${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}" > ./passphrase - name: Create recovery run: echo "${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}" > ./recovery - name: Initialize wallet run: ./vegawallet init -f - name: Import wallet run: ./vegawallet import -w UI_Trading_Test --recovery-phrase-file ./recovery -p ./passphrase - name: Import config run: ./vegawallet network import --from-url https://raw.githubusercontent.com/vegaprotocol/networks/master/fairground/fairground.toml - name: Create public key 2 run: ./vegawallet key generate -w UI_Trading_Test -p ./passphrase - name: Start service run: ./vegawallet service run --network fairground & - name: Run Cypress tests env: CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }} CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }} run: npx nx affected:e2e --parallel=5 --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome