mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-12-04 14:11:28 +09:00
1618 lines
51 KiB
YAML
1618 lines
51 KiB
YAML
name: 'Deploy workflow'
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
|
|
env:
|
|
QT_MIRROR: https://mirrors.ocf.berkeley.edu/qt/ # https://download.qt.io/static/mirrorlist/
|
|
|
|
jobs:
|
|
Detect-Changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
recipes_changed: ${{ steps.filter.outputs.recipes }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
recipes:
|
|
- 'recipes/**'
|
|
- 'conanfile.py'
|
|
- '.github/workflows/deploy.yml'
|
|
- 'cmake/conan_provider.cmake'
|
|
- 'cmake/platform_settings.cmake'
|
|
- 'cmake/recipes_bootstrap.cmake'
|
|
|
|
Bake-Prebuilts-Linux:
|
|
runs-on: ubuntu-22.04
|
|
needs: Detect-Changes
|
|
if: needs.Detect-Changes.outputs.recipes_changed == 'true'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Build dependencies'
|
|
shell: bash
|
|
run: |
|
|
for build_type in Release Debug; do
|
|
cmake -S . -B build -DPREBUILTS_ONLY=1 "-DCMAKE_BUILD_TYPE=$build_type"
|
|
done
|
|
|
|
- name: 'Authorize in remote'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan remote login amnezia "${{ secrets.CONAN_USER }}" -p "${{ secrets.CONAN_PASSWORD }}"
|
|
|
|
- name: 'Upload baked prebuilts'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan upload -r amnezia "*" -c
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Build-Linux-Ubuntu:
|
|
runs-on: ubuntu-22.04
|
|
|
|
needs: Bake-Prebuilts-Linux
|
|
if: ${{ always() }}
|
|
|
|
env:
|
|
QT_VERSION: 6.10.1
|
|
QIF_VERSION: 4.7
|
|
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
|
|
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
|
|
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
|
|
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
|
|
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
|
|
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
|
|
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
|
|
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
|
|
|
|
steps:
|
|
- name: 'Install Qt'
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'linux'
|
|
target: 'desktop'
|
|
arch: 'linux_gcc_64'
|
|
modules: 'qtremoteobjects qt5compat qtshadertools qthttpserver qtwebsockets'
|
|
dir: ${{ runner.temp }}
|
|
setup-python: 'true'
|
|
tools: 'tools_ifw'
|
|
set-env: 'true'
|
|
aqtversion: '==3.3.0'
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Setup python'
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Install system packages'
|
|
run: sudo apt-get install libxkbcommon-x11-0 libsecret-1-dev
|
|
|
|
- name: 'Get sources'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- name: 'Build project'
|
|
shell: bash
|
|
env:
|
|
QT_INSTALL_DIR: ${{ runner.temp }}
|
|
AMNEZIA_BUILD_TESTS: ON
|
|
run: deploy/build.sh --generator Ninja --installer all
|
|
|
|
- name: 'Upload Linux test build'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux-build
|
|
path: deploy/build/client/tests
|
|
retention-days: 7
|
|
|
|
- name: 'Upload installer artifact'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/build/AmneziaVPN_*_linux_x64.run
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
- name: 'Upload translations artifact'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: AmneziaVPN_translations
|
|
path: client/translations
|
|
retention-days: 7
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Bake-Prebuilts-Windows:
|
|
runs-on: windows-latest
|
|
needs: Detect-Changes
|
|
if: needs.Detect-Changes.outputs.recipes_changed == 'true'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Build dependencies'
|
|
run: cmake -S . -B build -DPREBUILTS_ONLY=1
|
|
|
|
- name: 'Authorize in remote'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan remote login amnezia "${{ secrets.CONAN_USER }}" -p "${{ secrets.CONAN_PASSWORD }}"
|
|
|
|
- name: 'Upload baked prebuilts'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan upload -r amnezia "*" -c
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Build-Windows:
|
|
runs-on: windows-latest
|
|
|
|
needs: Bake-Prebuilts-Windows
|
|
if: ${{ always() }}
|
|
|
|
env:
|
|
QT_VERSION: 6.10.1
|
|
QIF_VERSION: 4.7
|
|
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
|
|
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
|
|
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
|
|
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
|
|
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
|
|
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
|
|
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
|
|
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
|
|
|
|
steps:
|
|
- name: 'Get sources'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- name: 'Install Qt'
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'windows'
|
|
target: 'desktop'
|
|
arch: 'win64_msvc2022_64'
|
|
modules: 'qtremoteobjects qt5compat qtshadertools qthttpserver qtwebsockets'
|
|
dir: ${{ runner.temp }}
|
|
setup-python: 'true'
|
|
tools: 'tools_ifw'
|
|
set-env: 'true'
|
|
aqtversion: '==3.3.0'
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Setup mvsc'
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: 'x64'
|
|
|
|
- name: 'Setup .NET SDK'
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '8.0.x'
|
|
|
|
- name: 'Install WiX Toolset'
|
|
shell: powershell
|
|
run: |
|
|
dotnet tool install --global wix --version 4.0.6
|
|
wix extension add -g WixToolset.UI.wixext/4.0.6
|
|
wix extension add -g WixToolset.Util.wixext/4.0.6
|
|
wix extension list -g
|
|
$wixBinDir = Join-Path $env:USERPROFILE ".dotnet\tools"
|
|
echo "WIX_BIN_DIR=$wixBinDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
|
|
|
- name: 'Setup python'
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Build project'
|
|
shell: cmd
|
|
env:
|
|
QT_INSTALL_DIR: ${{ runner.temp }}
|
|
AMNEZIA_BUILD_TESTS: ON
|
|
run: |
|
|
set WIX_ROOT_PATH="${{ env.USERPROFILE }}\.dotnet\tools"
|
|
deploy\build.bat --installer all
|
|
|
|
- name: 'Upload Windows test build'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: windows-build
|
|
path: |
|
|
deploy/build/client/tests
|
|
deploy/build/client/Release
|
|
retention-days: 7
|
|
|
|
- name: 'Upload WIX installer artifact'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/build/AmneziaVPN_*_windows_x64.msi
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
- name: 'Upload IFW installer artifact'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/build/AmneziaVPN_*_windows_x64.exe
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Bake-Prebuilts-iOS:
|
|
needs: Detect-Changes
|
|
if: needs.Detect-Changes.outputs.recipes_changed == 'true'
|
|
|
|
strategy:
|
|
matrix:
|
|
xcode-version: [26.0, 26.4]
|
|
include:
|
|
- xcode-version: 26.4
|
|
os: macos-26
|
|
|
|
runs-on: ${{ matrix.os || 'macos-latest' }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: ${{ matrix.xcode-version }}
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Build dependencies'
|
|
run: cmake -S . -B build -G Xcode -DPREBUILTS_ONLY=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos
|
|
|
|
- name: 'Authorize in remote'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan remote login amnezia "${{ secrets.CONAN_USER }}" -p "${{ secrets.CONAN_PASSWORD }}"
|
|
|
|
- name: 'Upload baked prebuilts'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan upload -r amnezia "*" -c
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Build-iOS:
|
|
runs-on: macos-26
|
|
|
|
needs: Bake-Prebuilts-iOS
|
|
if: ${{ always() }}
|
|
|
|
env:
|
|
QT_VERSION: 6.10.1
|
|
KEYCHAIN_PASSWORD: ""
|
|
|
|
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
|
|
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
|
|
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
|
|
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
|
|
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
|
|
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
|
|
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
|
|
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
|
|
|
|
steps:
|
|
- name: 'Get sources'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- uses: ./.github/actions/apple-setup-keychain
|
|
id: setup-keychain
|
|
with:
|
|
keychain-password: ${{ env.KEYCHAIN_PASSWORD }}
|
|
|
|
- name: 'Install signing certificate'
|
|
uses: ./.github/actions/apple-install-cert
|
|
with:
|
|
keychain-path: ${{ steps.setup-keychain.outputs.keychain-path }}
|
|
keychain-password: ${{ env.KEYCHAIN_PASSWORD }}
|
|
cert-base64: ${{ secrets.IOS_SIGNING_CERT_BASE64 }}
|
|
cert-password: ${{ secrets.IOS_SIGNING_CERT_PASSWORD }}
|
|
|
|
- name: 'Install app provisioning profile'
|
|
uses: ./.github/actions/apple-setup-provisioning-profile
|
|
with:
|
|
provisioning_profile_base64: ${{ secrets.IOS_APP_PROVISIONING_PROFILE }}
|
|
|
|
- name: 'Install NE provisioning profile'
|
|
uses: ./.github/actions/apple-setup-provisioning-profile
|
|
with:
|
|
provisioning_profile_base64: ${{ secrets.IOS_NE_PROVISIONING_PROFILE }}
|
|
|
|
- name: 'Setup xcode'
|
|
uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: '26.0'
|
|
|
|
- name: 'Install desktop Qt'
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'mac'
|
|
target: 'desktop'
|
|
modules: 'qtremoteobjects qt5compat qtshadertools qtmultimedia'
|
|
arch: 'clang_64'
|
|
dir: ${{ runner.temp }}
|
|
set-env: 'true'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Install iOS Qt'
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'mac'
|
|
target: 'ios'
|
|
modules: 'qtremoteobjects qt5compat qtshadertools qtmultimedia'
|
|
dir: ${{ runner.temp }}
|
|
setup-python: 'true'
|
|
set-env: 'true'
|
|
extra: '--external 7z --base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Setup python'
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- name: 'Install deps'
|
|
run: pip install "conan==2.28.0" jsonschema jinja2
|
|
|
|
- name: 'Build project'
|
|
env:
|
|
QT_INSTALL_DIR: ${{ runner.temp }}
|
|
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
|
|
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
|
|
APPSTORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
|
|
run: |
|
|
sh deploy/build.sh -t ios | \
|
|
sed -e '/-Xcc -DPROD_AGW_PUBLIC_KEY/,/-Xcc/ { /-Xcc/!d; }' -e '/-Xcc -DPROD_AGW_PUBLIC_KEY/d' | \
|
|
sed -e '/-Xcc -DDEV_AGW_PUBLIC_KEY/,/-Xcc/ { /-Xcc/!d; }' -e '/-Xcc -DDEV_AGW_PUBLIC_KEY/d' | \
|
|
sed -e '/-DPROD_AGW_PUBLIC_KEY/,/-D/ { /-D/!d; }' -e '/-DPROD_AGW_PUBLIC_KEY/d' | \
|
|
sed -e '/-DDEV_AGW_PUBLIC_KEY/,/-D/ { /-D/!d; }' -e '/-DDEV_AGW_PUBLIC_KEY/d'
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Bake-Prebuilts-MacOS:
|
|
needs: Detect-Changes
|
|
if: needs.Detect-Changes.outputs.recipes_changed == 'true'
|
|
|
|
strategy:
|
|
matrix:
|
|
xcode-version: [16.2, 16.4, 26.4]
|
|
include:
|
|
- xcode-version: 16.2
|
|
os: macos-15
|
|
- xcode-version: 16.4
|
|
os: macos-15
|
|
- xcode-version: 26.4
|
|
os: macos-26
|
|
|
|
runs-on: ${{ matrix.os || 'macos-latest' }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: ${{ matrix.xcode-version }}
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Build dependencies'
|
|
run: cmake -S . -B build -G Xcode -DPREBUILTS_ONLY=1
|
|
|
|
- name: 'Authorize in remote'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan remote login amnezia "${{ secrets.CONAN_USER }}" -p "${{ secrets.CONAN_PASSWORD }}"
|
|
|
|
- name: 'Upload baked prebuilts'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan upload -r amnezia "*" -c
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Build-MacOS:
|
|
runs-on: macos-26
|
|
|
|
needs: Bake-Prebuilts-MacOS
|
|
if: ${{ always() }}
|
|
|
|
env:
|
|
QT_VERSION: 6.10.1
|
|
KEYCHAIN_PASSWORD: ""
|
|
|
|
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
|
|
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
|
|
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
|
|
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
|
|
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
|
|
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
|
|
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
|
|
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
|
|
|
|
steps:
|
|
- name: 'Get sources'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- uses: ./.github/actions/apple-setup-keychain
|
|
id: setup-keychain
|
|
with:
|
|
keychain-password: ${{ env.KEYCHAIN_PASSWORD }}
|
|
|
|
- uses: ./.github/actions/apple-install-cert
|
|
with:
|
|
keychain-path: ${{ steps.setup-keychain.outputs.keychain-path }}
|
|
keychain-password: ${{ env.KEYCHAIN_PASSWORD }}
|
|
cert-base64: ${{ secrets.MAC_APP_CERT_CERT }}
|
|
cert-password: ${{ secrets.MAC_APP_CERT_PW }}
|
|
|
|
- uses: ./.github/actions/apple-install-cert
|
|
with:
|
|
keychain-path: ${{ steps.setup-keychain.outputs.keychain-path }}
|
|
keychain-password: ${{ env.KEYCHAIN_PASSWORD }}
|
|
cert-base64: ${{ secrets.MAC_INSTALLER_SIGNER_CERT }}
|
|
cert-password: ${{ secrets.MAC_INSTALL_CERT_PW }}
|
|
|
|
- name: 'Setup xcode'
|
|
uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: '26.3.0'
|
|
|
|
- name: 'Install Qt'
|
|
uses: jurplel/install-qt-action@v4.3.1
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'mac'
|
|
target: 'desktop'
|
|
arch: 'clang_64'
|
|
modules: 'qtremoteobjects qt5compat qtshadertools qthttpserver qtwebsockets'
|
|
dir: ${{ runner.temp }}
|
|
setup-python: 'true'
|
|
set-env: 'true'
|
|
aqtversion: '==3.3.0'
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Setup python'
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Build project'
|
|
env:
|
|
QT_INSTALL_DIR: ${{ runner.temp }}
|
|
CODESIGN_SIGNATURE: ${{ secrets.MAC_SIGNER_ID }}
|
|
CODESIGN_INSTALLER_SIGNATURE: ${{ secrets.MAC_INSTALLER_SIGNER_ID }}
|
|
CODESIGN_KEYCHAIN: ${{ steps.setup-keychain.outputs.keychain-path }}
|
|
CODESIGN_INSTALLER_KEYCHAIN: ${{ steps.setup-keychain.outputs.keychain-path }}
|
|
NOTARYTOOL_TEAM_ID: ${{ secrets.MAC_TEAM_ID }}
|
|
NOTARYTOOL_EMAIL: ${{ secrets.APPLE_DEV_EMAIL }}
|
|
NOTARYTOOL_PASSWORD: ${{ secrets.APPLE_DEV_PASSWORD }}
|
|
AMNEZIA_BUILD_TESTS: ON
|
|
shell: bash
|
|
run: deploy/build.sh --generator Ninja --installer all
|
|
|
|
- name: 'Upload macOS test build'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: macos-build
|
|
path: deploy/build/client/tests
|
|
retention-days: 7
|
|
|
|
- name: 'Upload installer artifact'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/build/AmneziaVPN_*_macos_x64.pkg
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Bake-Prebuilts-MacOS-NE:
|
|
needs: Detect-Changes
|
|
if: needs.Detect-Changes.outputs.recipes_changed == 'true'
|
|
|
|
strategy:
|
|
matrix:
|
|
xcode-version: [16.2, 16.4, 26.4]
|
|
include:
|
|
- xcode-version: 16.2
|
|
os: macos-15
|
|
- xcode-version: 16.4
|
|
os: macos-15
|
|
- xcode-version: 26.4
|
|
os: macos-26
|
|
|
|
runs-on: ${{ matrix.os || 'macos-latest' }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: ${{ matrix.xcode-version }}
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Build dependencies'
|
|
run: cmake -S . -B build -G Xcode -DPREBUILTS_ONLY=1 -DMACOS_NE=TRUE
|
|
|
|
- name: 'Authorize in remote'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan remote login amnezia "${{ secrets.CONAN_USER }}" -p "${{ secrets.CONAN_PASSWORD }}"
|
|
|
|
- name: 'Upload baked prebuilts'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan upload -r amnezia "*" -c
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Build-MacOS-NE:
|
|
runs-on: macos-26
|
|
|
|
needs: Bake-Prebuilts-MacOS-NE
|
|
if: ${{ always() }}
|
|
|
|
env:
|
|
QT_VERSION: 6.10.1
|
|
|
|
MAC_TEAM_ID: ${{ secrets.MAC_TEAM_ID }}
|
|
|
|
MAC_APP_CERT_CERT: ${{ secrets.MAC_APP_CERT_CERT }}
|
|
MAC_SIGNER_ID: ${{ secrets.MAC_SIGNER_ID }}
|
|
MAC_APP_CERT_PW: ${{ secrets.MAC_APP_CERT_PW }}
|
|
|
|
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
|
|
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
|
|
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
|
|
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
|
|
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
|
|
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
|
|
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
|
|
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
|
|
|
|
steps:
|
|
- name: 'Get sources'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- uses: ./.github/actions/apple-setup-provisioning-profile
|
|
with:
|
|
provisioning_profile_base64: ${{ secrets.MAC_APP_PROVISIONING_PROFILE }}
|
|
|
|
- uses: ./.github/actions/apple-setup-provisioning-profile
|
|
with:
|
|
provisioning_profile_base64: ${{ secrets.MAC_NE_PROVISIONING_PROFILE }}
|
|
|
|
- name: 'Setup xcode'
|
|
uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: '26.1'
|
|
|
|
- name: 'Install desktop Qt'
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'mac'
|
|
target: 'desktop'
|
|
modules: 'qtremoteobjects qt5compat qtshadertools qtmultimedia qthttpserver qtwebsockets'
|
|
arch: 'clang_64'
|
|
dir: ${{ runner.temp }}
|
|
set-env: 'true'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Install go'
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
cache: false
|
|
|
|
- name: 'Setup gomobile'
|
|
run: |
|
|
export PATH=$PATH:~/go/bin
|
|
go install golang.org/x/mobile/cmd/gomobile@latest
|
|
gomobile init
|
|
|
|
- name: 'Setup python'
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Build project'
|
|
run: |
|
|
export QT_BIN_DIR="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/macos/bin"
|
|
bash deploy/build_macos_ne.sh
|
|
|
|
- name: 'Upload unpacked artifact'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: AmneziaVPN_MacOS_unpacked
|
|
path: deploy/build/client/AmneziaVPN.app
|
|
retention-days: 7
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Bake-Prebuilts-Android:
|
|
runs-on: android-runner
|
|
needs: Detect-Changes
|
|
if: needs.Detect-Changes.outputs.recipes_changed == 'true'
|
|
|
|
env:
|
|
ANDROID_PLATFORM: android-28
|
|
NDK_VERSION: 27.0.11718014
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Setup Android SDK'
|
|
uses: android-actions/setup-android@v4
|
|
with:
|
|
packages: "platforms;${{ env.ANDROID_PLATFORM }} ndk;${{ env.NDK_VERSION }}"
|
|
|
|
- name: 'Build dependencies'
|
|
run: |
|
|
CMAKE_ANDROID_NDK="$ANDROID_HOME/ndk/$NDK_VERSION"
|
|
args=(
|
|
-G Ninja
|
|
-DPREBUILTS_ONLY=1
|
|
-DCMAKE_SYSTEM_NAME=Android
|
|
"-DANDROID_PLATFORM=$ANDROID_PLATFORM"
|
|
"-DCMAKE_ANDROID_NDK=$CMAKE_ANDROID_NDK"
|
|
)
|
|
|
|
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
|
|
for build_type in Release Debug; do
|
|
cmake -S . -B build_${abi//-/_} "${args[@]}" "-DCMAKE_ANDROID_ARCH_ABI=$abi" "-DCMAKE_BUILD_TYPE=$build_type"
|
|
done
|
|
done
|
|
|
|
- name: 'Authorize in remote'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan remote login amnezia "${{ secrets.CONAN_USER }}" -p "${{ secrets.CONAN_PASSWORD }}"
|
|
|
|
- name: 'Upload baked prebuilts'
|
|
if: github.ref == 'refs/heads/dev'
|
|
run: conan upload -r amnezia "*" -c
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Build-Android:
|
|
runs-on: android-runner
|
|
|
|
needs: Bake-Prebuilts-Android
|
|
if: ${{ always() }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- label: 'android9-10'
|
|
qt_version: '6.10.1'
|
|
min_sdk: 28
|
|
max_sdk: 29
|
|
version_code_offset: 0
|
|
build_aab: true
|
|
- label: 'android11+'
|
|
qt_version: '6.10.3'
|
|
min_sdk: 30
|
|
max_sdk: ''
|
|
version_code_offset: 1
|
|
build_aab: true
|
|
- label: 'android9-10-qt610-3'
|
|
qt_version: '6.10.3'
|
|
min_sdk: 28
|
|
max_sdk: 29
|
|
version_code_offset: 0
|
|
build_aab: false
|
|
|
|
env:
|
|
ANDROID_PLATFORM: android-${{ matrix.min_sdk }}
|
|
NDK_VERSION: 27.0.11718014
|
|
QT_VERSION: ${{ matrix.qt_version }}
|
|
QT_MODULES: 'qtremoteobjects qt5compat qtimageformats qtshadertools'
|
|
APP_ANDROID_MIN_SDK: ${{ matrix.min_sdk }}
|
|
APP_ANDROID_MAX_SDK: ${{ matrix.max_sdk }}
|
|
APP_ANDROID_VERSION_CODE_OFFSET: ${{ matrix.version_code_offset }}
|
|
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
|
|
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
|
|
FALLBACK_S3_ENDPOINT: ${{ secrets.FALLBACK_S3_ENDPOINT }}
|
|
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
|
|
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
|
|
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
|
|
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
|
|
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
|
|
|
|
steps:
|
|
- name: 'Get sources'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: 'Install desktop Qt'
|
|
uses: jurplel/install-qt-action@v4.3.1
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'linux'
|
|
target: 'desktop'
|
|
arch: 'linux_gcc_64'
|
|
modules: ${{ env.QT_MODULES }}
|
|
dir: ${{ runner.temp }}
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Install android_x86_64 Qt'
|
|
uses: jurplel/install-qt-action@v4.3.1
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'all_os'
|
|
target: 'android'
|
|
arch: 'android_x86_64'
|
|
modules: ${{ env.QT_MODULES }}
|
|
dir: ${{ runner.temp }}
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Install android_x86 Qt'
|
|
uses: jurplel/install-qt-action@v4.3.1
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'all_os'
|
|
target: 'android'
|
|
arch: 'android_x86'
|
|
modules: ${{ env.QT_MODULES }}
|
|
dir: ${{ runner.temp }}
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Install android_armv7 Qt'
|
|
uses: jurplel/install-qt-action@v4.3.1
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'all_os'
|
|
target: 'android'
|
|
arch: 'android_armv7'
|
|
modules: ${{ env.QT_MODULES }}
|
|
dir: ${{ runner.temp }}
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Install android_arm64_v8a Qt'
|
|
uses: jurplel/install-qt-action@v4.3.1
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'all_os'
|
|
target: 'android'
|
|
arch: 'android_arm64_v8a'
|
|
modules: ${{ env.QT_MODULES }}
|
|
dir: ${{ runner.temp }}
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Setup Java'
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
|
|
- name: 'Setup Android SDK'
|
|
uses: android-actions/setup-android@v4
|
|
with:
|
|
packages: "platforms;${{ env.ANDROID_PLATFORM }} ndk;${{ env.NDK_VERSION }}"
|
|
|
|
- name: 'Setup python'
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.14
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
- name: 'Decode keystore secret to file'
|
|
env:
|
|
KEYSTORE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }}
|
|
shell: bash
|
|
run: |
|
|
echo $KEYSTORE_BASE64 | base64 --decode > android.keystore
|
|
|
|
- name: 'Build project'
|
|
env:
|
|
QT_INSTALL_DIR: ${{ runner.temp }}
|
|
QT_ANDROID_KEYSTORE_PATH: ${{ github.workspace }}/android.keystore
|
|
QT_ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_RELEASE_KEYSTORE_KEY_ALIAS }}
|
|
QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_RELEASE_KEYSTORE_KEY_PASS }}
|
|
LABEL: ${{ matrix.label }}
|
|
BUILD_AAB: ${{ matrix.build_aab }}
|
|
shell: bash
|
|
run: |
|
|
OUT=deploy/artifacts
|
|
rm -rf $OUT && mkdir -p $OUT
|
|
|
|
if [[ "$BUILD_AAB" == "true" ]]; then
|
|
deploy/build.sh -t android --sign --aab
|
|
else
|
|
deploy/build.sh -t android --sign
|
|
fi
|
|
|
|
VERSION=$(grep CMAKE_PROJECT_VERSION:STATIC deploy/build/CMakeCache.txt | cut -d= -f2)
|
|
|
|
mv deploy/build/client/android-build/AmneziaVPN.apk \
|
|
$OUT/AmneziaVPN_${VERSION}_${LABEL}_universal.apk
|
|
|
|
if [[ "$BUILD_AAB" == "true" ]]; then
|
|
mv deploy/build/client/android-build/build/outputs/bundle/ossRelease/android-build-oss-release.aab \
|
|
$OUT/AmneziaVPN_${VERSION}_${LABEL}_oss.aab
|
|
fi
|
|
|
|
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
|
|
deploy/build.sh -t android --sign --abi ${abi} --build ./deploy/build/${abi}
|
|
mv deploy/build/${abi}/client/android-build/AmneziaVPN.apk \
|
|
$OUT/AmneziaVPN_${VERSION}_${LABEL}_${abi}.apk
|
|
done
|
|
|
|
ls -l $OUT
|
|
|
|
- name: 'Build Play AAB'
|
|
if: ${{ matrix.build_aab }}
|
|
env:
|
|
QT_INSTALL_DIR: ${{ runner.temp }}
|
|
QT_ANDROID_KEYSTORE_PATH: ${{ github.workspace }}/android.keystore
|
|
QT_ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_RELEASE_KEYSTORE_KEY_ALIAS }}
|
|
QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_RELEASE_KEYSTORE_KEY_PASS }}
|
|
LABEL: ${{ matrix.label }}
|
|
shell: bash
|
|
run: |
|
|
OUT=deploy/artifacts
|
|
VERSION=$(grep CMAKE_PROJECT_VERSION:STATIC deploy/build/CMakeCache.txt | cut -d= -f2)
|
|
|
|
deploy/build.sh -t android --sign --aab --play --build ./deploy/build/play
|
|
|
|
mv deploy/build/play/client/android-build/build/outputs/bundle/playRelease/android-build-play-release.aab \
|
|
$OUT/AmneziaVPN_${VERSION}_${LABEL}_play.aab
|
|
|
|
- name: 'Upload universal APK'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/artifacts/*_universal.apk
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
- name: 'Upload arm64-v8a APK'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/artifacts/*_arm64-v8a.apk
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
- name: 'Upload armeabi-v7a APK'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/artifacts/*_armeabi-v7a.apk
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
- name: 'Upload x86 APK'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/artifacts/*_x86.apk
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
- name: 'Upload x86_64 APK'
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/artifacts/*_x86_64.apk
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
- name: 'Upload OSS AAB'
|
|
if: ${{ matrix.build_aab }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/artifacts/*_oss.aab
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
- name: 'Upload Play AAB'
|
|
if: ${{ matrix.build_aab }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: deploy/artifacts/*_play.aab
|
|
archive: false
|
|
retention-days: 7
|
|
|
|
# ------------------------------------------------------
|
|
|
|
Extra:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Search a corresponding PR
|
|
uses: octokit/request-action@v2.x
|
|
id: pull_request
|
|
with:
|
|
route: GET /repos/${{ github.repository }}/pulls
|
|
head: ${{ github.repository_owner }}:${{ github.ref_name }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Add PR link to build summary
|
|
if: ${{ fromJSON(steps.pull_request.outputs.data)[0].number != '' }}
|
|
run: |
|
|
echo "Pull request:" >> $GITHUB_STEP_SUMMARY
|
|
echo "[[#${{ fromJSON(steps.pull_request.outputs.data)[0].number }}] ${{ fromJSON(steps.pull_request.outputs.data)[0].title }}](${{ fromJSON(steps.pull_request.outputs.data)[0].html_url }})" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# ------------------------------------------------------
|
|
|
|
test-linux:
|
|
name: Test Linux (${{ matrix.filter }})
|
|
needs: Build-Linux-Ubuntu
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
filter:
|
|
- MultipleImportsTest
|
|
- ServerEditTest
|
|
- DefaultServerChangeTest
|
|
- ServerEdgeCasesTest
|
|
- SignalOrderTest
|
|
- ServersModelSyncTest
|
|
- ServerRenameTest
|
|
- SettingsSignalsTest
|
|
- UiServersModelAndControllerTest
|
|
- XraySerializationTest
|
|
- UiLanguageModelAndControllerTest
|
|
- UiIpModelAndControllerTest
|
|
- UiAppSTModelAndControllerTest
|
|
- UiAllowedDnsModelAndControllerTest
|
|
- BackupExportImportTest
|
|
- FavoriteLocationsRestoreTest
|
|
- ConnectionTest
|
|
- OpenSSLLibraryTest
|
|
- GatewayServiceImportTest
|
|
- ClientManagementModelTest
|
|
- ProtocolsModelTest
|
|
- ServersModelTest
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
env:
|
|
QT_VERSION: 6.10.1
|
|
QTEST_FUNCTION_TIMEOUT: 7200000
|
|
THIRD_PARTY_AWG_VPN_KEY: ${{ secrets.THIRD_PARTY_AWG_VPN_KEY }}
|
|
THIRD_PARTY_WIRE_GUARD_VPN_KEY: ${{ secrets.THIRD_PARTY_WIRE_GUARD_VPN_KEY }}
|
|
THIRD_PARTY_XRAY_VPN_KEY: ${{ secrets.THIRD_PARTY_XRAY_VPN_KEY }}
|
|
THIRD_PARTY_OPEN_VPN_KEY: ${{ secrets.THIRD_PARTY_OPEN_VPN_KEY }}
|
|
THIRD_PARTY_CLOAK_VPN_KEY: ${{ secrets.THIRD_PARTY_CLOAK_VPN_KEY }}
|
|
THIRD_PARTY_SS_VPN_KEY: ${{ secrets.THIRD_PARTY_SS_VPN_KEY }}
|
|
THIRD_PARTY_IKEV_VPN_KEY: ${{ secrets.THIRD_PARTY_IKEV_VPN_KEY }}
|
|
THIRD_PARTY_PREMIUM_VPN_KEY: ${{ secrets.THIRD_PARTY_PREMIUM_VPN_KEY }}
|
|
THIRD_PARTY_VMESS_NEW_IMPORT_DATA: ${{ secrets.THIRD_PARTY_VMESS_NEW_IMPORT_DATA }}
|
|
THIRD_PARTY_VMESS_IMPORT_DATA: ${{ secrets.THIRD_PARTY_VMESS_IMPORT_DATA }}
|
|
THIRD_PARTY_TROJAN_IMPORT_DATA: ${{ secrets.THIRD_PARTY_TROJAN_IMPORT_DATA }}
|
|
THIRD_PARTY_VLESS_IMPORT_DATA: ${{ secrets.THIRD_PARTY_VLESS_IMPORT_DATA }}
|
|
THIRD_PARTY_SHADOWSOCKS_IMPORT_DATA: ${{ secrets.THIRD_PARTY_SHADOWSOCKS_IMPORT_DATA }}
|
|
THIRD_PARTY_SHADOWSOCKS_SUBSCRIPTION_IMPORT_DATA: ${{ secrets.THIRD_PARTY_SHADOWSOCKS_SUBSCRIPTION_IMPORT_DATA }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- name: Decode backup file
|
|
if: matrix.filter == 'BackupExportImportTest'
|
|
shell: bash
|
|
env:
|
|
BACKUP_FILE_BASE64: ${{ secrets.BACKUP_FILE_BASE64 }}
|
|
run: |
|
|
if [ -z "$BACKUP_FILE_BASE64" ]; then
|
|
echo "::error::BACKUP_FILE_BASE64 secret is not set"
|
|
exit 1
|
|
fi
|
|
echo "$BACKUP_FILE_BASE64" | base64 --decode > "$RUNNER_TEMP/test.backup"
|
|
echo "BACKUP_PATH=$RUNNER_TEMP/test.backup" >> "$GITHUB_ENV"
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: linux
|
|
target: desktop
|
|
arch: linux_gcc_64
|
|
modules: qtremoteobjects qt5compat qtshadertools qthttpserver qtwebsockets
|
|
dir: ${{ runner.temp }}
|
|
set-env: true
|
|
aqtversion: '==3.3.0'
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: Install system packages
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libxkbcommon-x11-0 \
|
|
libsecret-1-dev
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: linux-build
|
|
path: deploy/build/client/tests
|
|
|
|
- name: Restore executable permissions
|
|
run: |
|
|
find deploy/build/client/tests \
|
|
-type f \
|
|
-name "test_*" \
|
|
-exec chmod +x {} \;
|
|
|
|
- name: Run tests
|
|
env:
|
|
AMNEZIA_TEST_API_KEY: ${{ secrets.AMNEZIA_TEST_API_KEY }}
|
|
shell: bash
|
|
run: |
|
|
QT_ROOT="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/gcc_64"
|
|
|
|
export LD_LIBRARY_PATH="$PWD/deploy/build/client/tests:$QT_ROOT/lib:${LD_LIBRARY_PATH:-}"
|
|
export QT_QPA_PLATFORM=offscreen
|
|
|
|
ctest --test-dir deploy/build/client/tests --output-on-failure -VV --timeout 600 -R "^${{ matrix.filter }}$"
|
|
|
|
# ------------------------------------------------------
|
|
|
|
test-vps:
|
|
name: Test self-hosted VPS
|
|
needs: Build-Linux-Ubuntu
|
|
|
|
# These tests install and remove docker containers on a single shared VPS:
|
|
# two runs at once corrupt each other's state, so only one job may touch it.
|
|
concurrency:
|
|
group: vps-tests
|
|
cancel-in-progress: false
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
env:
|
|
QT_VERSION: 6.10.1
|
|
QTEST_FUNCTION_TIMEOUT: 7200000
|
|
SELF_HOSTED_SERVER_HOST_NAME: ${{ secrets.SELF_HOSTED_SERVER_HOST_NAME }}
|
|
SELF_HOSTED_SERVER_USER_NAME: ${{ secrets.SELF_HOSTED_SERVER_USER_NAME }}
|
|
SELF_HOSTED_SERVER_PASSWORD: ${{ secrets.SELF_HOSTED_SERVER_PASSWORD }}
|
|
SELF_HOSTED_SERVER_SSH_PORT: ${{ secrets.SELF_HOSTED_SERVER_SSH_PORT }}
|
|
SELF_HOSTED_ADMIN_EXPORT_ROUND_TRIP_VPN_KEY: ${{ secrets.SELF_HOSTED_ADMIN_EXPORT_ROUND_TRIP_VPN_KEY }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v3
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: linux
|
|
target: desktop
|
|
arch: linux_gcc_64
|
|
modules: qtremoteobjects qt5compat qtshadertools qthttpserver qtwebsockets
|
|
dir: ${{ runner.temp }}
|
|
set-env: true
|
|
aqtversion: '==3.3.0'
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: Install system packages
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libxkbcommon-x11-0 \
|
|
libsecret-1-dev
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: linux-build
|
|
path: deploy/build/client/tests
|
|
|
|
- name: Restore executable permissions
|
|
run: |
|
|
find deploy/build/client/tests \
|
|
-type f \
|
|
-name "test_*" \
|
|
-exec chmod +x {} \;
|
|
|
|
- name: Run tests
|
|
shell: bash
|
|
run: |
|
|
QT_ROOT="${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/gcc_64"
|
|
|
|
export LD_LIBRARY_PATH="$PWD/deploy/build/client/tests:$QT_ROOT/lib:${LD_LIBRARY_PATH:-}"
|
|
export QT_QPA_PLATFORM=offscreen
|
|
|
|
ctest --test-dir deploy/build/client/tests --output-on-failure -VV \
|
|
-R "^(SelfHostedServerSetupTest|MultipleExportsTest|AdminSelfHostedExportTest)$"
|
|
|
|
# ------------------------------------------------------
|
|
|
|
test-windows:
|
|
name: Test Windows (${{ matrix.filter }})
|
|
needs: Build-Windows
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
filter:
|
|
- MultipleImportsTest
|
|
- ServerEditTest
|
|
- DefaultServerChangeTest
|
|
- ServerEdgeCasesTest
|
|
- SignalOrderTest
|
|
- ServersModelSyncTest
|
|
- ServerRenameTest
|
|
- SettingsSignalsTest
|
|
- UiServersModelAndControllerTest
|
|
- XraySerializationTest
|
|
- UiLanguageModelAndControllerTest
|
|
- UiIpModelAndControllerTest
|
|
- UiAppSTModelAndControllerTest
|
|
- UiAllowedDnsModelAndControllerTest
|
|
- BackupExportImportTest
|
|
- FavoriteLocationsRestoreTest
|
|
- ConnectionTest
|
|
- OpenSSLLibraryTest
|
|
- GatewayServiceImportTest
|
|
- ClientManagementModelTest
|
|
- ProtocolsModelTest
|
|
- ServersModelTest
|
|
|
|
runs-on: windows-latest
|
|
|
|
env:
|
|
QT_VERSION: 6.10.1
|
|
QTEST_FUNCTION_TIMEOUT: 7200000
|
|
THIRD_PARTY_AWG_VPN_KEY: ${{ secrets.THIRD_PARTY_AWG_VPN_KEY }}
|
|
THIRD_PARTY_WIRE_GUARD_VPN_KEY: ${{ secrets.THIRD_PARTY_WIRE_GUARD_VPN_KEY }}
|
|
THIRD_PARTY_XRAY_VPN_KEY: ${{ secrets.THIRD_PARTY_XRAY_VPN_KEY }}
|
|
THIRD_PARTY_OPEN_VPN_KEY: ${{ secrets.THIRD_PARTY_OPEN_VPN_KEY }}
|
|
THIRD_PARTY_CLOAK_VPN_KEY: ${{ secrets.THIRD_PARTY_CLOAK_VPN_KEY }}
|
|
THIRD_PARTY_SS_VPN_KEY: ${{ secrets.THIRD_PARTY_SS_VPN_KEY }}
|
|
THIRD_PARTY_IKEV_VPN_KEY: ${{ secrets.THIRD_PARTY_IKEV_VPN_KEY }}
|
|
THIRD_PARTY_PREMIUM_VPN_KEY: ${{ secrets.THIRD_PARTY_PREMIUM_VPN_KEY }}
|
|
THIRD_PARTY_VMESS_NEW_IMPORT_DATA: ${{ secrets.THIRD_PARTY_VMESS_NEW_IMPORT_DATA }}
|
|
THIRD_PARTY_VMESS_IMPORT_DATA: ${{ secrets.THIRD_PARTY_VMESS_IMPORT_DATA }}
|
|
THIRD_PARTY_TROJAN_IMPORT_DATA: ${{ secrets.THIRD_PARTY_TROJAN_IMPORT_DATA }}
|
|
THIRD_PARTY_VLESS_IMPORT_DATA: ${{ secrets.THIRD_PARTY_VLESS_IMPORT_DATA }}
|
|
THIRD_PARTY_SHADOWSOCKS_IMPORT_DATA: ${{ secrets.THIRD_PARTY_SHADOWSOCKS_IMPORT_DATA }}
|
|
THIRD_PARTY_SHADOWSOCKS_SUBSCRIPTION_IMPORT_DATA: ${{ secrets.THIRD_PARTY_SHADOWSOCKS_SUBSCRIPTION_IMPORT_DATA }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- name: Decode backup file
|
|
if: matrix.filter == 'BackupExportImportTest'
|
|
shell: pwsh
|
|
env:
|
|
BACKUP_FILE_BASE64: ${{ secrets.BACKUP_FILE_BASE64 }}
|
|
run: |
|
|
if ([string]::IsNullOrWhiteSpace($env:BACKUP_FILE_BASE64)) {
|
|
Write-Output "::error::BACKUP_FILE_BASE64 secret is not set"
|
|
exit 1
|
|
}
|
|
$backup = Join-Path $env:RUNNER_TEMP "test.backup"
|
|
$bytes = [Convert]::FromBase64String($env:BACKUP_FILE_BASE64)
|
|
[IO.File]::WriteAllBytes($backup, $bytes)
|
|
"BACKUP_PATH=$backup" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: windows-build
|
|
path: deploy/build/client
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: windows
|
|
target: desktop
|
|
arch: win64_msvc2022_64
|
|
modules: qtremoteobjects qt5compat qtshadertools qthttpserver qtwebsockets
|
|
dir: ${{ runner.temp }}
|
|
set-env: true
|
|
|
|
- name: Setup MSVC
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
with:
|
|
arch: x64
|
|
|
|
- name: Run tests
|
|
env:
|
|
AMNEZIA_TEST_API_KEY: ${{ secrets.AMNEZIA_TEST_API_KEY }}
|
|
shell: cmd
|
|
run: |
|
|
rem Without an attached console (GitHub runner), QTest sends its output to
|
|
rem OutputDebugString instead of stdout, so ctest captures nothing.
|
|
set QT_FORCE_STDERR_LOGGING=1
|
|
|
|
set PATH=%PATH%;%CD%\client\3rd-prebuilt\deploy-prebuilt\windows\x64
|
|
set PATH=%PATH%;%Qt6_DIR%\..\..\..\bin
|
|
|
|
ctest --test-dir deploy\build\client\tests -C Release -R "${{ matrix.filter }}" --output-on-failure -VV --timeout 600
|
|
|
|
# ------------------------------------------------------
|
|
|
|
test-macos:
|
|
name: Test macOS (${{ matrix.filter }})
|
|
needs: Build-MacOS
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
filter:
|
|
- MultipleImportsTest
|
|
- ServerEditTest
|
|
- DefaultServerChangeTest
|
|
- ServerEdgeCasesTest
|
|
- SignalOrderTest
|
|
- ServersModelSyncTest
|
|
- ServerRenameTest
|
|
- SettingsSignalsTest
|
|
- UiServersModelAndControllerTest
|
|
- XraySerializationTest
|
|
- UiLanguageModelAndControllerTest
|
|
- UiIpModelAndControllerTest
|
|
- UiAppSTModelAndControllerTest
|
|
- UiAllowedDnsModelAndControllerTest
|
|
- BackupExportImportTest
|
|
- FavoriteLocationsRestoreTest
|
|
- ConnectionTest
|
|
- OpenSSLLibraryTest
|
|
- GatewayServiceImportTest
|
|
- ClientManagementModelTest
|
|
- ProtocolsModelTest
|
|
- ServersModelTest
|
|
|
|
runs-on: macos-15
|
|
|
|
env:
|
|
QT_VERSION: 6.10.1
|
|
QTEST_FUNCTION_TIMEOUT: 7200000
|
|
THIRD_PARTY_AWG_VPN_KEY: ${{ secrets.THIRD_PARTY_AWG_VPN_KEY }}
|
|
THIRD_PARTY_WIRE_GUARD_VPN_KEY: ${{ secrets.THIRD_PARTY_WIRE_GUARD_VPN_KEY }}
|
|
THIRD_PARTY_XRAY_VPN_KEY: ${{ secrets.THIRD_PARTY_XRAY_VPN_KEY }}
|
|
THIRD_PARTY_OPEN_VPN_KEY: ${{ secrets.THIRD_PARTY_OPEN_VPN_KEY }}
|
|
THIRD_PARTY_CLOAK_VPN_KEY: ${{ secrets.THIRD_PARTY_CLOAK_VPN_KEY }}
|
|
THIRD_PARTY_SS_VPN_KEY: ${{ secrets.THIRD_PARTY_SS_VPN_KEY }}
|
|
THIRD_PARTY_IKEV_VPN_KEY: ${{ secrets.THIRD_PARTY_IKEV_VPN_KEY }}
|
|
THIRD_PARTY_PREMIUM_VPN_KEY: ${{ secrets.THIRD_PARTY_PREMIUM_VPN_KEY }}
|
|
THIRD_PARTY_VMESS_NEW_IMPORT_DATA: ${{ secrets.THIRD_PARTY_VMESS_NEW_IMPORT_DATA }}
|
|
THIRD_PARTY_VMESS_IMPORT_DATA: ${{ secrets.THIRD_PARTY_VMESS_IMPORT_DATA }}
|
|
THIRD_PARTY_TROJAN_IMPORT_DATA: ${{ secrets.THIRD_PARTY_TROJAN_IMPORT_DATA }}
|
|
THIRD_PARTY_VLESS_IMPORT_DATA: ${{ secrets.THIRD_PARTY_VLESS_IMPORT_DATA }}
|
|
THIRD_PARTY_SHADOWSOCKS_IMPORT_DATA: ${{ secrets.THIRD_PARTY_SHADOWSOCKS_IMPORT_DATA }}
|
|
THIRD_PARTY_SHADOWSOCKS_SUBSCRIPTION_IMPORT_DATA: ${{ secrets.THIRD_PARTY_SHADOWSOCKS_SUBSCRIPTION_IMPORT_DATA }}
|
|
|
|
steps:
|
|
- name: Setup Xcode
|
|
uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: "26.3.0"
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
fetch-depth: 10
|
|
|
|
- name: Decode backup file
|
|
if: matrix.filter == 'BackupExportImportTest'
|
|
shell: bash
|
|
env:
|
|
BACKUP_FILE_BASE64: ${{ secrets.BACKUP_FILE_BASE64 }}
|
|
run: |
|
|
if [ -z "$BACKUP_FILE_BASE64" ]; then
|
|
echo "::error::BACKUP_FILE_BASE64 secret is not set"
|
|
exit 1
|
|
fi
|
|
echo "$BACKUP_FILE_BASE64" | base64 --decode > "$RUNNER_TEMP/test.backup"
|
|
echo "BACKUP_PATH=$RUNNER_TEMP/test.backup" >> "$GITHUB_ENV"
|
|
|
|
- name: Download build
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: macos-build
|
|
path: deploy/build/client/tests
|
|
|
|
- name: Install Qt
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: mac
|
|
target: desktop
|
|
arch: clang_64
|
|
modules: qtremoteobjects qt5compat qtshadertools qthttpserver qtwebsockets
|
|
dir: ${{ runner.temp }}
|
|
set-env: true
|
|
|
|
- name: Restore executable permissions
|
|
run: |
|
|
find deploy/build/client/tests \
|
|
-type f \
|
|
-name "test_*" \
|
|
-exec chmod +x {} \;
|
|
|
|
- name: Run tests
|
|
env:
|
|
AMNEZIA_TEST_API_KEY: ${{ secrets.AMNEZIA_TEST_API_KEY }}
|
|
shell: bash
|
|
run: |
|
|
QT_ROOT="$RUNNER_TEMP/Qt/$QT_VERSION/macos"
|
|
|
|
export DYLD_LIBRARY_PATH="$PWD/deploy/build/client/tests:$QT_ROOT/lib:${DYLD_LIBRARY_PATH:-}"
|
|
|
|
ctest --test-dir deploy/build/client/tests -R "${{ matrix.filter }}" --output-on-failure -VV --timeout 600
|
|
|
|
# ------------------------------------------------------
|
|
|
|
test-android:
|
|
runs-on: android-runner
|
|
|
|
env:
|
|
ANDROID_PLATFORM: android-28
|
|
NDK_VERSION: 27.0.11718014
|
|
QT_VERSION: 6.10.1
|
|
QT_MODULES: 'qtremoteobjects qt5compat qtshadertools'
|
|
|
|
steps:
|
|
- name: 'Get sources'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 10
|
|
|
|
- name: 'Decode backup file'
|
|
run: |
|
|
echo "${{ secrets.BACKUP_FILE_BASE64 }}" | base64 --decode > /tmp/test.backup
|
|
echo "BACKUP_PATH=/tmp/test.backup" >> $GITHUB_ENV
|
|
|
|
|
|
- name: 'Install desktop Qt'
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'linux'
|
|
target: 'desktop'
|
|
arch: 'linux_gcc_64'
|
|
modules: ${{ env.QT_MODULES }}
|
|
dir: ${{ runner.temp }}
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Install android_x86_64 Qt'
|
|
uses: jurplel/install-qt-action@v4
|
|
with:
|
|
version: ${{ env.QT_VERSION }}
|
|
host: 'all_os'
|
|
target: 'android'
|
|
arch: 'android_x86_64'
|
|
modules: ${{ env.QT_MODULES }}
|
|
dir: ${{ runner.temp }}
|
|
py7zrversion: '==0.22.*'
|
|
extra: '--base ${{ env.QT_MIRROR }}'
|
|
|
|
- name: 'Setup Java'
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
|
|
- name: 'Setup Android SDK'
|
|
uses: android-actions/setup-android@v4
|
|
with:
|
|
packages: "platforms;${{ env.ANDROID_PLATFORM }} ndk;${{ env.NDK_VERSION }}"
|
|
|
|
- name: 'Setup python'
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.14'
|
|
|
|
- name: 'Install conan'
|
|
run: pip install "conan==2.28.0"
|
|
|
|
# Uncomment to sign APK with release keystore (requires secrets):
|
|
# - name: 'Decode keystore'
|
|
# env:
|
|
# KEYSTORE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }}
|
|
# run: echo $KEYSTORE_BASE64 | base64 --decode > android.keystore
|
|
|
|
- name: 'Configure (Android x86_64)'
|
|
env:
|
|
QT_ANDROID: ${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/android_x86_64
|
|
QT_HOST: ${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/gcc_64
|
|
CMAKE_ANDROID_NDK: ${{ env.ANDROID_HOME }}/ndk/${{ env.NDK_VERSION }}
|
|
run: |
|
|
cmake -S . -B build -G Ninja \
|
|
-DCMAKE_BUILD_TYPE=Debug \
|
|
-DCMAKE_TOOLCHAIN_FILE=$QT_ANDROID/lib/cmake/Qt6/qt.toolchain.cmake \
|
|
-DANDROID_PLATFORM=${{ env.ANDROID_PLATFORM }} \
|
|
-DCMAKE_ANDROID_NDK=$CMAKE_ANDROID_NDK \
|
|
-DQT_HOST_PATH=$QT_HOST \
|
|
-DANDROID_SDK_ROOT=$ANDROID_HOME \
|
|
-DAMNEZIA_BUILD_TESTS=ON
|
|
|
|
- name: 'Build Android tests'
|
|
# env:
|
|
# QT_ANDROID_KEYSTORE_PATH: ${{ github.workspace }}/android.keystore
|
|
# QT_ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_RELEASE_KEYSTORE_KEY_ALIAS }}
|
|
# QT_ANDROID_KEYSTORE_STORE_PASS: ${{ secrets.ANDROID_RELEASE_KEYSTORE_KEY_PASS }}
|
|
run: |
|
|
cmake --build build --target test_android_openssl_make_apk
|
|
cmake --build build --target test_android_restore_backup_make_apk
|
|
|
|
- name: 'Write Android test runner script'
|
|
run: |
|
|
cat > ci_run_android_tests.sh << 'EOF'
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ADB=$(which adb)
|
|
|
|
echo ">>> Waiting for package manager to be ready..."
|
|
"$ADB" shell 'while ! pm list packages > /dev/null 2>&1; do sleep 2; done'
|
|
echo ">>> Package manager ready."
|
|
|
|
run_test() {
|
|
local target="$1"
|
|
local apk="build/client/tests/android-build/${target}.apk"
|
|
local pkg_name="org.qtproject.example.${target}"
|
|
local activity="${pkg_name}/org.qtproject.qt.android.bindings.QtActivity"
|
|
|
|
echo ">>> Installing ${target} APK..."
|
|
timeout 120 "$ADB" install -r "$apk"
|
|
|
|
"$ADB" shell "run-as $pkg_name sh -c 'mkdir -p files && : > files/stdout.txt'" 2>/dev/null || true
|
|
"$ADB" shell "run-as $pkg_name sh -c 'rm -f files/qtest_last_exit_code'" 2>/dev/null || true
|
|
|
|
echo ">>> Launching ${target}..."
|
|
"$ADB" shell am start -n "$activity"
|
|
|
|
echo ">>> Waiting for test to finish (up to 120s)..."
|
|
local elapsed=0 exit_code=""
|
|
while [[ $elapsed -lt 120 ]]; do
|
|
sleep 2
|
|
elapsed=$((elapsed + 2))
|
|
exit_code=$("$ADB" shell \
|
|
"run-as $pkg_name cat files/qtest_last_exit_code 2>/dev/null" \
|
|
| tr -d '[:space:]' || true)
|
|
[[ -n "$exit_code" ]] && break
|
|
done
|
|
|
|
local stdout_content
|
|
stdout_content=$("$ADB" shell \
|
|
"run-as $pkg_name cat files/stdout.txt 2>/dev/null" || true)
|
|
if [[ -n "$stdout_content" ]]; then
|
|
echo ">>> Test output:"
|
|
echo "$stdout_content"
|
|
fi
|
|
|
|
if [[ -z "$exit_code" ]]; then
|
|
echo ">>> TIMEOUT: ${target} did not complete within 120s."
|
|
exit 1
|
|
elif [[ "$exit_code" != "0" ]]; then
|
|
echo ">>> ${target} FAILED (exit code: $exit_code)"
|
|
exit 1
|
|
else
|
|
echo ">>> ${target} PASSED"
|
|
fi
|
|
}
|
|
|
|
run_test test_android_openssl
|
|
run_test test_android_restore_backup
|
|
EOF
|
|
chmod +x ci_run_android_tests.sh
|
|
|
|
- name: 'Run Android tests on emulator'
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
with:
|
|
api-level: 28
|
|
arch: x86_64
|
|
emulator-options: -no-snapshot -no-window -no-audio -no-boot-anim -accel on
|
|
disable-animations: true
|
|
script: bash ci_run_android_tests.sh
|
|
|