diff --git a/.github/workflows/connect-dev-release-test.yml b/.github/workflows/connect-dev-release-test.yml index 4cf4ee115048..24131e7c2257 100644 --- a/.github/workflows/connect-dev-release-test.yml +++ b/.github/workflows/connect-dev-release-test.yml @@ -22,6 +22,8 @@ on: - "packages/transport/**" - "packages/utxo-lib/**" - "packages/utils/**" + - "packages/connect-examples/webextension-mv2/**" + - "packages/connect-examples/webextension-mv3/**" - "submodules/trezor-common/**" - "yarn.lock" - ".github/workflows/connect-dev-release-test.yml" @@ -116,3 +118,12 @@ jobs: with: test-name: unchained.test DEV_SERVER_HOSTNAME: dev.suite.sldev.cz + + webextension-examples: + needs: [build-deploy] + uses: ./.github/workflows/template-connect-popup-test-params.yml + with: + test-name: webextension-example.test + DEV_SERVER_HOSTNAME: dev.suite.sldev.cz + run-webextension: true + run-web: false diff --git a/.github/workflows/template-connect-popup-test-params.yml b/.github/workflows/template-connect-popup-test-params.yml index 2f9041ed18f7..f5a2193c8bb9 100644 --- a/.github/workflows/template-connect-popup-test-params.yml +++ b/.github/workflows/template-connect-popup-test-params.yml @@ -15,15 +15,23 @@ on: description: "Flag to indicate whether to run the webextension job" type: "boolean" required: false + default: false + run-web: + description: "Flag to indicate whether to run the web job" + type: "boolean" + required: false + default: true build-overview: description: "Flag to indicate whether to build connect-popup-overview.html" type: "boolean" required: false + default: false jobs: web: name: web runs-on: ubuntu-latest + if: ${{ inputs.run-web }} steps: - uses: actions/checkout@v4 with: @@ -67,7 +75,7 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: test-artifacts-${{ inputs.test-name }}-${{ github.run_attempt }} + name: web-test-artifacts-${{ inputs.test-name }}-${{ github.run_attempt }}-${{ github.run_id }} path: | packages/connect-popup/test-results @@ -92,16 +100,24 @@ jobs: run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT id: extract_branch - - name: Build webextension + - name: Install dependencies run: | yarn install --immutable yarn build:libs + + - name: Build webextension + run: | yarn workspace @trezor/connect-webextension build yarn workspace @trezor/connect-iframe build:core-module yarn workspace @trezor/connect-explorer build:webextension - - name: Make Docker Script Executable - run: chmod +x ./docker/docker-connect-popup-ci.sh + - name: Build example webextension + env: + URL: https://${{ inputs.DEV_SERVER_HOSTNAME }}/connect/${{ steps.extract_branch.outputs.branch }}/ + run: | + yarn workspace @trezor/connect-web build:webextension + yarn workspace @trezor/connect-web build:inline + node packages/connect-examples/update-webextensions.js --trezor-connect-src "${URL}" --npm-src "${URL}trezor-connect.js" - name: Run connect popup test env: @@ -116,7 +132,7 @@ jobs: if: failure() uses: actions/upload-artifact@v4 with: - name: test-artifacts-${{ inputs.test-name }}-${{ github.run_attempt }} + name: webextension-test-artifacts-${{ inputs.test-name }}-${{ github.run_attempt }}-${{ github.run_id }} path: | packages/connect-popup/test-results