-
Notifications
You must be signed in to change notification settings - Fork 44
72 lines (70 loc) · 2.4 KB
/
Copy pathtest-setup.yml
File metadata and controls
72 lines (70 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
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.2
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 }}"