--- name: test setup on: workflow_call: inputs: package: required: true type: string command: required: false type: string default: npm run test docker-services: required: false type: string run-nodes: required: false type: boolean default: false run-entry-point: required: false type: boolean default: false extra-log-prefix: required: false type: string browser: required: false type: boolean default: false jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - name: build (cached) uses: ./.github/workflows/reusable/cached-build - run: npm run check working-directory: 'packages/${{ inputs.package }}' - name: Fix Electron sandbox permissions # This step resolves the error: "The SUID sandbox helper binary was found, but is not configured correctly" # The issue began occurring after GitHub runners were upgraded to Ubuntu 24.04. A future upgrade of # Electron/Chromium or GitHub runners may render this workaround unnecessary. If that happens, this step # should be removed. if: ${{ inputs.browser }} run: | sudo chown root:root node_modules/electron/dist/chrome-sandbox sudo chmod 4755 node_modules/electron/dist/chrome-sandbox - name: install docker compose # TODO: this step probably belongs to streamr-docker-dev-action if: ${{ inputs.docker-services != '' }} run: sudo apt-get install -y docker-compose - name: start docker services if: ${{ inputs.docker-services != '' }} uses: streamr-dev/streamr-docker-dev-action@v1.0.1 with: services-to-start: ${{ inputs.docker-services }} - name: run entry point if: ${{ inputs.run-entry-point }} uses: ./.github/workflows/reusable/run-entry-point - name: run nodes if: ${{ inputs.run-nodes }} uses: ./.github/workflows/reusable/run-nodes - name: test working-directory: 'packages/${{ inputs.package }}' run: ${{ inputs.command }} - name: upload logs if: success() || failure() uses: ./.github/workflows/reusable/collect-and-upload-logs with: artifact_prefix: "${{ inputs.package }}${{inputs.extra-log-prefix }}"