Skip to content

Move msix signing to util/release.dart #3045

Move msix signing to util/release.dart

Move msix signing to util/release.dart #3045

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- '**/README.md'
pull_request:
branches: [master]
env:
cargo_cache_path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
ouisync/target/
jobs:
test_linux:
name: test on linux
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Create container name
run: echo "CONTAINER=ouisync-unit-test-linux-$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Start container
run: ./docker/linux.sh --container $CONTAINER --srcdir . --cache shared container start
- name: Analyze
run: ./docker/linux.sh --container $CONTAINER analyze
- name: Run tests
run: ./docker/linux.sh --container $CONTAINER unit-test
- name: Stop container
run: ./docker/linux.sh --container $CONTAINER container stop
if: always()
test_windows:
name: test on windows
runs-on: windows-latest
env:
# Install Dokan2.dll to where `flutter test` can find it
DOKAN_DLL_OUTPUT_PATH: C:\Windows\System32
OUISYNC_LIB: ouisync\target\debug\ouisync_service.dll
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup cargo cache
id: cargo-cache
uses: actions/cache@v4
with:
path: ${{ env.cargo_cache_path }}
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
# FIXME: when dokan is installed some tests fail with weird panic from the dokan-rust library.
# Disabling for now. See also the comment in the 'Run tests' step.
# - name: Install dependencies (windows)
# run: choco install dokany2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version-file: pubspec.yaml
cache: true
- name: Run Flutter doctor
run: flutter doctor -v
- name: Get Flutter packages
run: dart pub get
- name: Generate the Dart bindings for the Ouisync library
working-directory: ouisync/bindings/dart
run: dart tool/bindgen.dart
- name: Analyze
run: |
pushd lib
flutter analyze
popd
pushd test
flutter analyze
popd
pushd util
flutter analyze
popd
- name: Test util
run: |
dart util/test.dart
# HACK: dokan-sys puts Dokan2.dll to C:\Windows\System but not if it's cached (the crate
# doesn't rebuild itself when the dll is missing likely due to missing
# `cargo:rerun-if-changed` directive in its build.rs). Clean the cached version to force
# rebuild.
# TODO: We should patch dokan-sys to rebuild itself when the dll is missing.
- name: "[HACK] Force dokan-sys to build"
run: cargo clean --package dokan-sys
working-directory: ouisync
- name: Build Ouisync service library for tests
working-directory: ouisync
run: cargo build --package ouisync-service --lib --features vfs
- name: Run tests
# FIXME: The mount test fails on windows CI with a panic somewhere in the dokan-rust
# crate. Disabling for now but it needs to be looked into.
run: flutter test --exclude-tags mount
- name: Upload test/debug artifacts
uses: actions/upload-artifact@v4
with:
# Name of the produced zip file
name: test-artifacts-${{ runner.os }}
path: test/widget/artifacts/*
if-no-files-found: ignore
# Upload when tests fail
if: failure()
build_linux_and_android:
name: build on linux and android
runs-on: self-hosted
needs: [warmup_android]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build artifacts
run: |
./docker/linux.sh \
--container ouisync-build-linux-android-$GITHUB_RUN_ID \
--srcdir . \
--cache shared \
build \
--flavor nightly \
--out releases \
--type apk,deb-gui,deb-cli
env:
SECRET_SENTRY_DSN: ${{ secrets.NIGHTLY_SENTRY_DSN }}
SECRET_STORE_PASSWORD: ${{ secrets.NIGHTLY_KEYSTORE_PASSWORD }}
SECRET_KEY_ALIAS: nightly
SECRET_KEY_PASSWORD: ${{ secrets.NIGHTLY_KEYSTORE_PASSWORD }}
SECRET_KEYSTORE_HEX: ${{ secrets.NIGHTLY_KEYSTORE_JKS_HEX }}
- name: Upload linux artifacts
uses: actions/upload-artifact@v4
with:
name: linux
path: releases/ouisync*.deb
- name: Upload android artifacts
uses: actions/upload-artifact@v4
with:
name: android
path: releases/ouisync*.apk
build_windows:
name: build on windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup cargo cache
id: cargo-cache
uses: actions/cache@v4
with:
path: ${{ env.cargo_cache_path }}
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version-file: pubspec.yaml
cache: true
- name: Install Inno Setup (Windows exe installation builder)
run: |
Invoke-WebRequest https://files.jrsoftware.org/is/6/innosetup-6.4.3.exe -OutFile C:/TEMP/innosetup.exe
C:/TEMP/innosetup.exe /SP- /VERYSILENT /ALLUSERS /SUPPRESSMSGBOXES
shell: pwsh
- name: Get Flutter packages
run: dart pub get
- name: Generate the Dart bindings for the Ouisync library
working-directory: ouisync/bindings/dart
run: dart tool/bindgen.dart
- name: Setup Sentry DSN for artifact build (different from the production releases)
run: |
mkdir -p secrets/
echo $NIGHTLY_SENTRY_DSN > secrets/sentry_dsn
shell: bash
env:
NIGHTLY_SENTRY_DSN : ${{ secrets.NIGHTLY_SENTRY_DSN }}
if: env.NIGHTLY_SENTRY_DSN != null
- name: Build artifacts
run: |
sentry_dsn_path=secrets/sentry_dsn
sentry=$([ -f $sentry_dsn_path ] && echo "--sentry=$sentry_dsn_path" || true)
dart run util/release.dart --flavor=nightly $sentry --exe
shell: bash
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows
path: releases/release_*/ouisync*.exe
integration_test_android:
name: "run integration tests on android ${{ matrix.api-level }}"
runs-on: self-hosted
needs: [warmup_android]
strategy:
fail-fast: false
matrix:
api-level:
# These don't work due to various missing apis
# - 23
# - 24
# - 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run tests
run: |
./docker/linux.sh \
--container ouisync-integration-test-android-${{ matrix.api-level }}-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT \
--srcdir . \
--cache shared \
integration-test --platform android --api ${{ matrix.api-level }}
# - name: Upload logcat
# uses: actions/upload-artifact@v4
# with:
# # Name of the produced zip file
# name: logcat-${{ matrix.api-level }}
# path: logcat.txt
# if-no-files-found: ignore
# # Upload only when the tests fail
# if: failure() || cancelled()
warmup_android:
name: "warmup cache for android"
runs-on: self-hosted
concurrency: # ensure this job runs only once at a time
group: warmup
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Warmup cache
run: |
./docker/linux.sh \
--container ouisync-warmup-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT \
--srcdir . \
--cache exclusive \
warmup
# TODO: Integration tests on both linux and windows currently fail or hang. Commenting them out until they are fixed.
# integration_test_desktop:
# name: run integration tests on ${{ matrix.name }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# name: [linux, windows]
# include:
# - name: linux
# os: ubuntu-24.04
# - name: windows
# os: windows-latest
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: Setup cargo cache
# id: cargo-cache
# uses: actions/cache@v4
# with:
# path: ${{ env.cargo_cache_path }}
# key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: ${{ runner.os }}-cargo-
# - name: Install dependencies (linux)
# run: |
# sudo apt update -y
# sudo apt-get install libappindicator3-dev \
# libcurl4-openssl-dev \
# libfuse-dev \
# libgtk-3-dev \
# libsecret-1-dev \
# ninja-build \
# imagemagick
# if: matrix.name == 'linux'
# - uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# flutter-version-file: pubspec.yaml
# cache: true
# - name: Get Flutter packages
# run: dart pub get
# - name: Generate the Dart bindings for the Ouisync library
# working-directory: ouisync/bindings/dart
# run: dart tool/bindgen.dart
# # Note that xvfb is used only on linux. On other platforms the tests are run without any
# # special setup: https://github.com/marketplace/actions/setup-xvfb
# - name: Run tests
# uses: coactions/setup-xvfb@v1
# with:
# run: flutter test integration_test/ --dart-define OUISYNC_FLAVOR=itest --verbose