generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 1
159 lines (146 loc) · 5.49 KB
/
run-ui-tests.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
147
148
149
150
151
152
153
154
155
156
157
158
159
# GitHub Actions Workflow for launching UI tests on Linux, Windows, and Mac in the following steps:
# - prepare and launch IDE with your plugin and robot-server plugin, which is needed to interact with UI
# - wait for IDE to start
# - run UI tests with separate Gradle task
#
# Please check https://github.com/JetBrains/intellij-ui-test-robot for information about UI tests with IntelliJ Platform
#
# Workflow is triggered manually.
name: Run UI Tests
on:
workflow_dispatch
jobs:
getPlugin:
name: Download the plugin
outputs:
path: ${{ steps.path.outputs.path }}
runs-on: ubuntu-latest
steps:
- uses: dawidd6/action-download-artifact@v8
with:
workflow: build.yml
commit: ${{ env.GITHUB_SHA }}
name: ".+[Ss]urveyor-\\d.+"
name_is_regexp: true
path: plugin-artifact
- name: Get full path
id: path
run: |
echo "path=$(find plugin-artifact/*/*.zip)" >> $GITHUB_OUTPUT
- name: Upload artifact for testUI
uses: actions/upload-artifact@v4
with:
name: plugin
path: plugin-artifact/*/*.zip
testUI:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
needs: getPlugin
strategy:
fail-fast: false
max-parallel: 8
matrix:
os: [ macos-13, ubuntu-latest, windows-latest ]
ideDate: # Up to 2 versions per year, initial major ver release date should be not older than a year
# - IC-LATEST_EAP # TODO: Run this variant weekly
- IC-2024.1.4 # released on 21.06.2024, major from 04.04.2024
- IC-2023.3.7 # released on 10.06.2024, major from 06.12.2023
- IC-2023.1.7 # released on 10.06.2024, major from 28.03.2023
# - PC-LATEST_EAP # TODO: Run this variant weekly
- PC-2024.1.4 # released on 25.06.2024, major from 04.04.2024
- PC-2023.3.6 # released on 10.06.2024, major from 06.12.2023
- PC-2023.1.6 # released on 10.06.2024, major from 30.03.2023
# Versions should match https://jb.gg/android-studio-releases-list.xml
# TODO: - AS-TODO
exclude:
- os: windows-latest # IDE downloader doesn't know URL for this version on Win
ideDate: PC-2023.1.6
include:
- os: ubuntu-latest
runTests: |
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x24 &
sleep 10
./gradlew :plugin-test:test
reportName: ui-tests-linux
- os: macos-13
runTests: |
./gradlew :plugin-test:test
reportName: ui-tests-mac
- os: windows-latest
runTests: ./gradlew :plugin-test:test
reportName: ui-tests-windows
env:
PLUGIN_PATH: "${{ github.workspace }}/${{ needs.getPlugin.outputs.path }}"
steps:
- uses: actions/github-script@v7
id: prepare-IDE_CODE
with:
script: return "${{ matrix.ideDate }}".split("-", 2)[0]
result-encoding: string
- uses: actions/github-script@v7
id: prepare-IDE_VERSION
with:
script: return "${{ matrix.ideDate }}".split("-", 2)[1]
result-encoding: string
- name: Setup FFmpeg via action
uses: FedericoCarboni/setup-ffmpeg@v2
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
token: ${{ secrets.GITHUB_TOKEN }}
# Uncomment when migrating to version 14
# - name: Install homebrew (for FFmpeg)
# uses: Homebrew/actions/setup-homebrew@e05416b42376bcda221f9102c4f595f4994016be
# if: ${{ startsWith(matrix.os, 'macos-') }}
# - name: Setup FFmpeg via homebrew
# if: ${{ startsWith(matrix.os, 'macos-') }}
# run: brew install ffmpeg
# Setup Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
env:
IDE_CODE: ${{ steps.prepare-IDE_CODE.outputs.result }}
IDE_VERSION: ${{ steps.prepare-IDE_VERSION.outputs.result }}
with:
distribution: zulu
java-version: 17
# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
env:
IDE_CODE: ${{ steps.prepare-IDE_CODE.outputs.result }}
IDE_VERSION: ${{ steps.prepare-IDE_VERSION.outputs.result }}
with:
gradle-home-cache-cleanup: true
# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
- name: Disable artifact verification
run: rm gradle/verification-metadata.xml
- uses: actions/download-artifact@v4
with:
name: plugin
path: plugin-artifact
# Run tests
- name: Tests
env:
IDE_CODE: ${{ steps.prepare-IDE_CODE.outputs.result }}
IDE_VERSION: ${{ steps.prepare-IDE_VERSION.outputs.result }}
run: ${{ matrix.runTests }}
# Collect Tests Result of failed tests
- name: Move screenshot files
if: ${{ always() }}
run: |
mv plugin-test/screenshot plugin-test/build/reports
- name: Move video files
if: ${{ always() }}
run: |
mv plugin-test/video plugin-test/build/reports
- name: Collect Tests Result
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.reportName }}-${{ matrix.ideDate }}
path: |
plugin-test/build/reports