-
-
Notifications
You must be signed in to change notification settings - Fork 3
158 lines (141 loc) · 5.39 KB
/
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
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
file-changes:
runs-on: ubuntu-latest
outputs:
any: ${{ steps.check.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Get changed files
id: check
uses: tj-actions/changed-files@v45
with:
files: |
.github/workflows/tests.yml
gradle/libs.versions.toml
gradle/kotlin-js-store/**
**/*.kt
**/*.kts
tests:
strategy:
matrix:
os: [ macos-latest, ubuntu-24.04, windows-latest ]
runs-on: ${{ matrix.os }}
needs: [ file-changes ]
if: needs.file-changes.outputs.any == 'true'
steps:
- name: Install qBittorrent on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo add-apt-repository ppa:qbittorrent-team/qbittorrent-stable
sudo apt-get update
sudo apt-get install -y qbittorrent-nox
sudo apt-get install -y libcurl4-openssl-dev
qbittorrent-nox --daemon
sleep 10
pkill qbittorrent-nox
wget "https://github.com/webtorrent/webtorrent.io/raw/ae9660a25fd387a4b78d65e4205f111cab6e3da9/static/torrents/big-buck-bunny.torrent" -O ~/bbb.torrent
echo '
[LegalNotice]
Accepted=true
[Preferences]
WebUI\Enabled=true
WebUI\Username=admin
WebUI\Password_PBKDF2="@ByteArray(LcUuuGLBt/EdVIK+5OXJiw==:hnn+qrlOHqQoGNz0ieICrciBGotuiRqo4wdX5VmXBE4EsGwxTGNY+QyUDRDwoRCU2qpfKqVbU1tdK9XT/unNFg==)"
WebUI\Port=9090
WebUI\MaxAuthenticationFailCount=10000
' >> "$HOME/.config/qBittorrent/qBittorrent.conf"
qbittorrent-nox --daemon
- name: Install qBittorrent on macOS
if: startsWith(matrix.os, 'macos')
run: |
wget "https://github.com/webtorrent/webtorrent.io/raw/ae9660a25fd387a4b78d65e4205f111cab6e3da9/static/torrents/big-buck-bunny.torrent" -O ~/bbb.torrent
brew install qbittorrent
open -a /Applications/qBittorrent.app
sleep 10
pkill -f qBittorrent
echo '
[LegalNotice]
Accepted=true
[Preferences]
WebUI\Enabled=true
WebUI\Username=admin
WebUI\Password_PBKDF2="@ByteArray(LcUuuGLBt/EdVIK+5OXJiw==:hnn+qrlOHqQoGNz0ieICrciBGotuiRqo4wdX5VmXBE4EsGwxTGNY+QyUDRDwoRCU2qpfKqVbU1tdK9XT/unNFg==)"
WebUI\Port=9090
WebUI\MaxAuthenticationFailCount=10000
' >> "$HOME/.config/qBittorrent/qBittorrent.ini"
open -a /Applications/qBittorrent.app
- name: Install qBittorrent on Windows
if: startsWith(matrix.os, 'windows')
run: |
Invoke-WebRequest -Uri "https://github.com/webtorrent/webtorrent.io/raw/ae9660a25fd387a4b78d65e4205f111cab6e3da9/static/torrents/big-buck-bunny.torrent" -OutFile "$env:USERPROFILE\bbb.torrent"
choco install qbittorrent -y --no-progress
Start-Process "C:\Program Files\qBittorrent\qbittorrent.exe" -WindowStyle Hidden
Start-Sleep -Seconds 10
Get-Process qbittorrent | Stop-Process
Add-Content -Path "$env:APPDATA\qBittorrent\qBittorrent.ini" -Value '
[LegalNotice]
Accepted=true
[Preferences]
WebUI\Enabled=true
WebUI\Username=admin
WebUI\Password_PBKDF2="@ByteArray(LcUuuGLBt/EdVIK+5OXJiw==:hnn+qrlOHqQoGNz0ieICrciBGotuiRqo4wdX5VmXBE4EsGwxTGNY+QyUDRDwoRCU2qpfKqVbU1tdK9XT/unNFg==)"
WebUI\Port=9090
WebUI\MaxAuthenticationFailCount=10000
'
Start-Process "C:\Program Files\qBittorrent\qbittorrent.exe" -WindowStyle Hidden
Get-Content "$env:APPDATA\qBittorrent\qBittorrent.ini"
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
- uses: gradle/actions/setup-gradle@v4
- name: Cache Build files
uses: actions/cache@v4
with:
path: |
~/.konan
~/.gradle
%USERPROFILE%\.gradle
%USERPROFILE%\.konan
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}
- name: Test Apple Targets
if: startsWith(matrix.os, 'macos')
run: ./gradlew macosArm64Test # iosTest tvosTest watchosX86Test
- name: Test Jvm Target
if: startsWith(matrix.os, 'ubuntu')
run: ./gradlew jvmTest
- name: Test Linux Target
if: startsWith(matrix.os, 'ubuntu')
run: ./gradlew linuxX64Test
- name: Test Js Targets
if: startsWith(matrix.os, 'ubuntu')
run: ./gradlew jsNodeTest
- name: Test Windows Target
if: startsWith(matrix.os, 'windows')
run: ./gradlew mingwX64Test
- name: Publish Test Reports
uses: mikepenz/action-junit-report@v4
if: always()
with:
check_name: JUnit Test Report (${{ matrix.os }})
include_passed: true
report_paths: '**/build/test-results/**/TEST-*.xml'
- name: Archive test reports
uses: actions/upload-artifact@v4
if: always()
with:
name: test-reports-${{ matrix.os }}
path: client/build/reports/tests/**/**