HOTFIX Build vodozemac on runner #4464
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
name: Tests | |
env: | |
FLUTTER_VERSION: 3.32.8 | |
jobs: | |
code_analyze: | |
name: Analyze code | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
actions: write | |
checks: write | |
pull-requests: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: "stable" | |
cache: true | |
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}" | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Run code analysis | |
run: ./scripts/code_analyze.sh | |
widget_test: | |
name: Widget test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: "stable" | |
cache: true | |
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}" | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Get Flutter dependencies | |
run: flutter pub get | |
- name: Set PUB_CACHE path manually | |
run: | | |
echo "PUB_CACHE=/home/runner/.pub-cache" >> $GITHUB_ENV | |
echo "✅ PUB_CACHE set to $PUB_CACHE" | |
# Explicitly search inside hosted/pub.dev/flutter_vodozemac-*/rust | |
- name: Find flutter_vodozemac rust directory | |
id: find-vodozemac | |
run: | | |
set -e | |
VODOZEMAC_PATH=$(find $PUB_CACHE/hosted/pub.dev -maxdepth 3 -type d -path "*/flutter_vodozemac-*/rust" | head -n 1) | |
if [ -z "$VODOZEMAC_PATH" ]; then | |
echo "❌ flutter_vodozemac-*/rust directory not found!" | |
echo "Contents of pub cache:" | |
find $PUB_CACHE/hosted/pub.dev -maxdepth 2 -type d | |
exit 1 | |
fi | |
echo "✅ Found flutter_vodozemac path: $VODOZEMAC_PATH" | |
echo "VODOZEMAC_PATH=$VODOZEMAC_PATH" >> $GITHUB_ENV | |
- name: Cache Cargo | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
${{ env.VODOZEMAC_PATH }}/target | |
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-debug- | |
- name: Build flutter_vodozemac Rust library (Debug) | |
run: | | |
cd $VODOZEMAC_PATH | |
cargo build | |
- name: Copy built "libvodozemac_bindings_dart.so" to existing directory | |
run: | | |
echo "Copying .so files into ./vodozemac/debug/..." | |
find $VODOZEMAC_PATH/target/debug -name "libvodozemac_bindings_dart.so" -exec cp -f {} ./vodozemac/debug/ \; | |
echo "✅ Contents of ./vodozemac/debug/:" | |
ls -l ./vodozemac/debug | |
- name: Run widget test | |
run: | | |
flutter pub run build_runner build -d | |
flutter test | |
# integration_test: | |
# name: Integration test | |
# runs-on: macos-latest | |
# strategy: | |
# matrix: | |
# homeserver: | |
# - synapse | |
# - dendrite | |
# - conduit | |
# # flavor: | |
# # - nongoogle | |
# fail-fast: false | |
# steps: | |
# - name: Checkout repo | |
# uses: actions/checkout@v4 | |
# - name: Setup flutter | |
# uses: subosito/flutter-action@v2 | |
# with: | |
# flutter-version: ${{ env.FLUTTER_VERSION }} | |
# channel: "stable" | |
# cache: true | |
# - name: Setup Java | |
# uses: actions/setup-java@v4 | |
# with: | |
# distribution: "temurin" | |
# java-version: "11" | |
# - name: Install dependencies | |
# run: | | |
# brew install ldns grep scrcpy ffmpeg docker | |
# flutter pub get | |
# colima start | |
# - name: Prepare homeservers | |
# env: | |
# HOMESERVER: localhost | |
# run: | | |
# # Create test users environment variables | |
# source ./scripts/integration-create-environment-variables.sh | |
# # Create matrix homeservers containers | |
# ./scripts/integration-server-${{ matrix.homeserver }}.sh | |
# # Set homeserver IP and create test users | |
# ./scripts/integration-prepare-homeserver.sh | |
# # Set users environment variables for next step | |
# echo USER1_NAME="alice" >> $GITHUB_ENV | |
# echo USER1_PW="AliceInWonderland">> $GITHUB_ENV | |
# echo USER2_NAME="bob" >> $GITHUB_ENV | |
# echo USER2_PW="JoWirSchaffenDas" >> $GITHUB_ENV | |
# # - name: Run integration tests for non-Google builds | |
# # uses: reactivecircus/android-emulator-runner@v2 | |
# # if: matrix.flavor == 'nongoogle' | |
# # env: | |
# # HOMESERVER: localhost | |
# # with: | |
# # api-level: 31 | |
# # target: google_apis | |
# # arch: x86_64 | |
# # script: | | |
# # scrcpy --no-display --record video-${{ matrix.flavor }}.mkv & | |
# # flutter test integration_test --dart-define=HOMESERVER=$HOMESERVER --dart-define=USER1_NAME=$USER1_NAME --dart-define=USER2_NAME=$USER2_NAME --dart-define=USER1_PW=$USER1_PW --dart-define=USER2_PW=$USER2_PW || ( sleep 10 && exit 1 ) | |
# # # Convert the video record to mp4 | |
# # ffmpeg -i video-${{ matrix.flavor }}.mkv -vf scale=iw/2:-2 -crf 40 -b:v 2000k -preset fast video-${{ matrix.flavor }}.mp4 || true | |
# # timeout-minutes: 30 | |
# - name: Run integration tests for Google builds | |
# uses: reactivecircus/android-emulator-runner@v2 | |
# # if: matrix.flavor == 'google' | |
# env: | |
# HOMESERVER: localhost | |
# with: | |
# api-level: 31 | |
# target: google_apis | |
# arch: x86_64 | |
# script: | | |
# scrcpy --no-display --record video-${{ matrix.flavor }}.mkv & | |
# flutter test integration_test --dart-define=HOMESERVER=$HOMESERVER --dart-define=USER1_NAME=$USER1_NAME --dart-define=USER2_NAME=$USER2_NAME --dart-define=USER1_PW=$USER1_PW --dart-define=USER2_PW=$USER2_PW || ( sleep 10 && exit 1 ) | |
# # Convert the video record to mp4 | |
# ffmpeg -i video-${{ matrix.flavor }}.mkv -vf scale=iw/2:-2 -crf 40 -b:v 2000k -preset fast video-${{ matrix.flavor }}.mp4 || true | |
# pre-emulator-launch-script: | | |
# git apply ./scripts/enable-android-google-services.patch | |
# timeout-minutes: 30 | |
# - name: Upload video | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: integration-test-recording | |
# path: video-${{ matrix.flavor }}.mp4 |