-
Notifications
You must be signed in to change notification settings - Fork 68
106 lines (102 loc) · 3.73 KB
/
Automated Test (short).yml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Starts up one BrowserStack session per platform, then runs each test in succession.
# That's relatively fast, but less thorough, since a failed test aborts any successive tests.
name: Automated Test (short)
on:
# push:
# branches: '**'
# pull_request:
# branches: '**'
workflow_dispatch:
inputs:
repo:
description: 'PsychoJS repo (psychopy/psychojs)'
required: false
ref:
description: 'branch/tag/SHA (default branch)'
required: false
testrun:
description: 'testrun (short)'
required: false
subset:
description: 'subset (true)'
required: false
platform:
description: 'platform (\*)'
required: false
label:
description: 'label (short)'
required: false
env:
BROWSERSTACK_ACCESSKEY: ${{ secrets.BROWSERSTACK_ACCESSKEY }}
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
STAGING_PASSWORD: ${{ secrets.STAGING_PASSWORD }}
STAGING_PORT: ${{ secrets.STAGING_PORT }}
STAGING_USERNAME: ${{ secrets.STAGING_USERNAME }}
PSYCHOJS_PATH: '/home/runner/work/psychojs/psychojs/psychojs'
DEFAULT_REPO: 'psychopy/psychojs'
DEFAULT_TESTRUN: 'short'
DEFAULT_SUBSET: 'true'
DEFAULT_PLATFORM: '\*'
DEFAULT_LABEL: 'short'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '15'
# START: install psychojs_testing
- name: Checkout psychojs_testing
uses: actions/checkout@v2
with:
repository: psychopy/psychojs_testing
path: psychojs_testing
- name: Cache modules psychojs_testing
uses: actions/cache@v2
env:
cache-name: cache-modules-psychojs_testing
with:
path: ~/psychojs_testing/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-:
- name: Install psychojs_testing
run: npm --prefix psychojs_testing ci
# END: install psychojs_testing
# START: install psychojs
- name: Checkout psychojs
uses: actions/checkout@v2
with:
repository: ${{github.event.inputs.repo || env.DEFAULT_REPO}}
ref: ${{github.event.inputs.ref}}
path: psychojs
- name: Cache modules psychojs
uses: actions/cache@v2
env:
cache-name: cache-modules-psychojs
with:
path: ~/psychojs/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-:
- name: Install psychojs
run: npm --prefix psychojs ci
# END: install psychojs
# START: wait for other workflows to complete
- name: Turnstyle (wait for other workflows to complete)
uses: softprops/turnstyle@v1
with:
poll-interval-seconds: 10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# END: wait for other workflows to complete
# START: run tests
- name: Run tests
run: node test.cjs --server bs --testrun ${{github.event.inputs.testrun || env.DEFAULT_TESTRUN}} --subset ${{github.event.inputs.subset || env.DEFAULT_SUBSET}} --platform ${{github.event.inputs.platform || env.DEFAULT_PLATFORM}} --url stager --uploadExperiments --uploadResults --label ${{github.event.inputs.label || env.DEFAULT_LABEL}}
working-directory: ./psychojs_testing
# END: run tests