Repository navigation
134 lines (121 loc) · 4.7 KB
/
Copy pathsimplex-platforms.yml
File metadata and controls
134 lines (121 loc) · 4.7 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
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
name: SimpleX platforms
# Builds webrtc-java for the platforms SimpleX Chat desktop ships on, tests each
# on a runner that can load its natives, and uploads natives-<platform> and
# main-jar artifacts. Called by simplex-build.yml and simplex-release.yml.
on:
workflow_call:
inputs:
version:
description: "The project version to build. Empty keeps the version of the poms."
type: string
default: ''
retention-days:
description: "How long the artifacts are kept."
type: number
default: 1
libwebrtc-artifact:
description: "Upload the linux_x86-64 libwebrtc install directory too."
type: boolean
default: false
jobs:
build:
name: build (${{ matrix.platform.name }})
strategy:
fail-fast: false
matrix:
# profile: the Maven profile of a cross compiled classifier.
# test-java-architecture: the JDK that loads cross compiled natives
# (Rosetta runs the Intel macOS tests on Apple Silicon).
platform:
- name: linux_x86-64
runs-on: ubuntu-22.04
classifier: linux-x86_64
test: true
main-jar: true
- name: linux_arm64
runs-on: ubuntu-22.04
classifier: linux-aarch64
profile: linux-aarch64
- name: macos_arm64
runs-on: macos-14
classifier: macos-aarch64
test: true
- name: macos_x86-64
runs-on: macos-14
classifier: macos-x86_64
profile: macos-cross-x86_64
test: true
test-java-architecture: x64
- name: windows_x86_64
runs-on: windows-2022
classifier: windows-x86_64
test: true
runs-on: ${{ matrix.platform.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: recursive
- name: Prepare build
if: runner.os == 'Linux'
uses: ./.github/actions/prepare-linux
- name: Prepare build
if: runner.os == 'macOS'
uses: ./.github/actions/prepare-macos
- name: Prepare build
if: runner.os == 'Windows'
uses: ./.github/actions/prepare-windows
- name: Maven build
uses: ./.github/actions/simplex-build
with:
platform-name: ${{ matrix.platform.name }}
classifier: ${{ matrix.platform.classifier }}
profile: ${{ matrix.platform.profile }}
version: ${{ inputs.version }}
test: ${{ matrix.platform.test }}
test-java-architecture: ${{ matrix.platform.test-java-architecture }}
upload-main-jar: ${{ matrix.platform.main-jar }}
upload-libwebrtc: ${{ inputs.libwebrtc-artifact && matrix.platform.name == 'linux_x86-64' }}
retention-days: ${{ inputs.retention-days }}
test-linux-arm64:
name: test (linux_arm64)
needs: build
runs-on: ubuntu-22.04-arm
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download natives
uses: actions/download-artifact@v8
with:
name: natives-linux_arm64
path: natives
# The cubeb audio device module tests need a sound server with devices.
- name: Install runtime libraries and start PulseAudio
run: |
sudo apt-get update
sudo apt-get install -y pulseaudio pulseaudio-utils libx11-6 libxext6 libxfixes3 libxdamage1 libxtst6 libxrandr2 libxcomposite1 libglib2.0-0 libgbm1 libdrm2
pulseaudio --start --exit-idle-time=-1
pactl load-module module-null-sink sink_name=ci_sink
pactl load-module module-null-source source_name=ci_source
pactl info
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
- name: Set the project version
if: inputs.version != ''
env:
VERSION: ${{ inputs.version }}
run: mvn -B -q org.codehaus.mojo:versions-maven-plugin:2.18.0:set -DnewVersion="$VERSION" -DgenerateBackupPoms=false
# webrtc-jni stays out of the reactor, so the natives come from the
# local repository and, for certain, from the test class path.
- name: Test
run: |
VERSION=$(sed -n '0,/<version>/s|.*<version>\([^<]*\)</version>.*|\1|p' pom.xml)
JAR="$PWD/natives/webrtc-java-$VERSION-linux-aarch64.jar"
mvn -B -q install:install-file -Dfile="$JAR" -DgroupId=dev.onvoid.webrtc \
-DartifactId=webrtc-java -Dversion="$VERSION" -Dpackaging=jar \
-Dclassifier=linux-aarch64
mvn -B -pl webrtc test -Dmaven.test.additionalClasspath="$JAR"