forked from AysherInc/Arelle
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (136 loc) · 5.89 KB
/
test-ui.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Run UI Tests
on:
workflow_dispatch:
inputs:
edgar_renderer_ref:
description: 'Arelle/EdgarRenderer branch, tag or SHA to checkout (blank for default)'
required: false
type: string
ixbrl_viewer_ref:
description: 'Workiva/ixbrl-viewer branch, tag or SHA to checkout (blank for default)'
required: false
type: string
node_version:
default: '19'
description: 'Node.js version to use'
required: false
type: string
python_version:
default: '3.11'
description: 'Python version to use'
required: false
type: string
xule_ref:
description: 'xbrlus/xule branch, tag or SHA to checkout (blank for default)'
required: false
type: string
pull_request:
branches:
- master
jobs:
build-windows-dispatch:
if: github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/build-windows.yml
with:
edgar_renderer_ref: ${{ inputs.edgar_renderer_ref }}
ixbrl_viewer_ref: ${{ inputs.ixbrl_viewer_ref }}
node_version: ${{ inputs.node_version }}
python_version: ${{ inputs.python_version }}
xule_ref: ${{ inputs.xule_ref }}
build-windows-pr:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/build-windows.yml
ui-tests:
needs: [build-windows-dispatch, build-windows-pr]
# https://github.com/actions/runner/issues/491
if: always() && (needs.build-windows-dispatch.result == 'success' || needs.build-windows-pr.result == 'success') && !cancelled()
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
build-type:
- installer
- zip
- source
env:
exe_artifact_versioned_name: ${{ github.event_name == 'pull_request' && needs.build-windows-pr.outputs.exe_artifact_versioned_name || needs.build-windows-dispatch.outputs.exe_artifact_versioned_name }}
zip_artifact_versioned_name: ${{ github.event_name == 'pull_request' && needs.build-windows-pr.outputs.zip_artifact_versioned_name || needs.build-windows-dispatch.outputs.zip_artifact_versioned_name }}
exe_uploaded_artifact_name: ${{ github.event_name == 'pull_request' && needs.build-windows-pr.outputs.exe_uploaded_artifact_name || needs.build-windows-dispatch.outputs.exe_uploaded_artifact_name }}
zip_uploaded_artifact_name: ${{ github.event_name == 'pull_request' && needs.build-windows-pr.outputs.zip_uploaded_artifact_name || needs.build-windows-dispatch.outputs.zip_uploaded_artifact_name }}
steps:
- name: Checkout arelle
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Download installer artifact
if: matrix.build-type == 'installer'
uses: actions/[email protected]
with:
name: ${{ env.exe_uploaded_artifact_name }}
- name: Download ZIP artifact
if: matrix.build-type == 'zip'
uses: actions/[email protected]
with:
name: ${{ env.zip_uploaded_artifact_name }}
- name: Install Arelle
if: matrix.build-type == 'installer'
run: start-process ${{ env.exe_artifact_versioned_name }} -argumentlist /S -nonewwindow -wait
- name: Extract artifact
if: matrix.build-type == 'zip'
run: expand-archive ${{ env.zip_artifact_versioned_name }} build
- name: Install Python
if: matrix.build-type == 'source'
uses: actions/[email protected]
with:
cache: 'pip'
check-latest: true
python-version: ${{ github.event_name == 'workflow_dispatch' && inputs.python_version || '3.11' }}
- name: Install Python dependencies
if: matrix.build-type == 'source'
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- name: Install runner
run: nuget install NUnit.ConsoleRunner
- name: Build tests
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
run: dotnet build tests\integration_tests\ui_tests\ArelleGUITest\ArelleGUITest.sln
- name: Set build path
run: echo "BUILD_PATH=$((gi tests\integration_tests\ui_tests\ArelleGUITest\ArelleGUITest\bin\Debug\*).FullName)" >> $env:GITHUB_ENV
- name: Run tests
if: matrix.build-type == 'installer' || matrix.build-type == 'zip'
env:
ARELLE_USE_BUILD: 'true'
ARELLE_PATH: ${{ matrix.build-type == 'zip' && format('{0}/build', github.workspace) || '' }}
ARELLE_RESOURCES_PATH: ${{ github.workspace }}\tests\integration_tests\ui_tests\resources
DOTNET_CLI_TELEMETRY_OPTOUT: 1
run: dotnet test ${{ env.BUILD_PATH }}\ArelleGUITest.dll --test-adapter-path:(gi .\NUnit.ConsoleRunner*\tools\nunit3-console.exe).FullName
- name: Run tests
if: matrix.build-type == 'source'
env:
ARELLE_PATH: ${{ github.workspace }}
ARELLE_RESOURCES_PATH: ${{ github.workspace }}\tests\integration_tests\ui_tests\resources
ARELLE_PYTHON_EXE: python
DOTNET_CLI_TELEMETRY_OPTOUT: 1
run: dotnet test ${{ env.BUILD_PATH }}\ArelleGUITest.dll --test-adapter-path:(gi .\NUnit.ConsoleRunner*\tools\nunit3-console.exe).FullName
- name: Upload logs
if: always()
uses: actions/[email protected]
with:
name: logs-${{ matrix.build-type }}
path: 'c:\temp\testsmedia\*.txt'
- name: Upload screenshots
# screenshots are only taken on test failure
if: failure()
uses: actions/[email protected]
with:
name: screenshots-${{ matrix.build-type }}
path: 'c:\temp\testsmedia\*.png'
- name: Upload videos
# videos are only saved on test failure
if: failure()
uses: actions/[email protected]
with:
name: videos-${{ matrix.build-type }}
path: 'c:\temp\testsmedia\*.avi'