mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-05 06:55:13 +01:00
79 lines
3.0 KiB
YAML
79 lines
3.0 KiB
YAML
name: "[Template] connect unit"
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
testPattern:
|
|
description: "Test pattern to use to match for test files (example: `init` or `methods`)"
|
|
type: "string"
|
|
required: true
|
|
includeFilter:
|
|
description: "List of methods to include in tests (example: applySettings,applyFlags,getFeatures)"
|
|
type: "string"
|
|
required: false
|
|
testsFirmware:
|
|
description: "Firmware version for the tests (example: 2-latest, 2.2.0, 2-main)"
|
|
type: "string"
|
|
required: false
|
|
default: "2-latest"
|
|
testFirmwareModel:
|
|
description: "Firmware model for the tests (example: T3T1)"
|
|
type: "string"
|
|
required: false
|
|
testDescription:
|
|
description: "A description to make test title more descriptive (example: T3T1-latest)"
|
|
type: "string"
|
|
required: false
|
|
default: ""
|
|
testRandomizedOrder:
|
|
description: "Tests will be run in randomized order"
|
|
type: "boolean"
|
|
required: false
|
|
default: false
|
|
# After migrating from testnet 3 to testnet 4 using `disable_cache_tx=true` should be required for tests where tx are used.
|
|
disable_cache_tx:
|
|
description: "Disable Cache transactions (when `true` tests don't use cache for transactions)"
|
|
type: "string"
|
|
required: false
|
|
default: false
|
|
transport:
|
|
description: "Transport to use (example: bridge, node-bridge)"
|
|
type: "string"
|
|
required: false
|
|
default: "node-bridge"
|
|
testEnv:
|
|
description: "Environment to test (example: node, web)"
|
|
type: "string"
|
|
required: true
|
|
|
|
jobs:
|
|
test:
|
|
name: "${{ inputs.testDescription }}"
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
- name: Setup node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
cache: yarn
|
|
- run: yarn workspaces focus @trezor/connect
|
|
- if: ${{ inputs.testEnv == 'web' }}
|
|
run: |
|
|
echo -e "\nenableScripts: false" >> .yarnrc.yml
|
|
yarn workspaces focus @trezor/connect-web
|
|
yarn && yarn build:libs
|
|
- if: ${{ inputs.disable_cache_tx == 'true' }}
|
|
run: echo "ADDITIONAL_ARGS=-c" >> "$GITHUB_ENV"
|
|
- if: ${{ inputs.testFirmwareModel }}
|
|
run: echo "ADDITIONAL_ARGS=$ADDITIONAL_ARGS -m ${{ inputs.testFirmwareModel }}" >> "$GITHUB_ENV"
|
|
- if: ${{ inputs.includeFilter }}
|
|
run: echo "ADDITIONAL_ARGS=$ADDITIONAL_ARGS -i ${{ inputs.includeFilter }}" >> "$GITHUB_ENV"
|
|
- if: ${{ inputs.testRandomizedOrder }}
|
|
run: echo "ADDITIONAL_ARGS=$ADDITIONAL_ARGS -r" >> "$GITHUB_ENV"
|
|
- if: ${{ inputs.transport }}
|
|
run: echo "ADDITIONAL_ARGS=$ADDITIONAL_ARGS -t ${{ inputs.transport }}" >> "$GITHUB_ENV"
|
|
- run: './docker/docker-connect-test.sh ${{ inputs.testEnv }} -p "${{ inputs.testPattern }}" -f "${{ inputs.testsFirmware }}" $ADDITIONAL_ARGS'
|