|
| 1 | +name: Build & Test |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + schedule: |
| 9 | + - cron: "0 10 * * *" # run everyday at 10 AM |
| 10 | + |
| 11 | +jobs: |
| 12 | + build_and_test: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + # Setup |
| 16 | + - uses: actions/checkout@v5 |
| 17 | + - uses: cachix/install-nix-action@v31 |
| 18 | + - uses: subosito/flutter-action@v2 # TODO remove this once flutter is in flake |
| 19 | + with: |
| 20 | + channel: beta |
| 21 | + - run: | |
| 22 | + # TODO remove this once patch lands |
| 23 | + flutter --version |
| 24 | + cd ${{ env.FLUTTER_ROOT }} |
| 25 | + curl https://patch-diff.githubusercontent.com/raw/flutter/flutter/pull/175323.patch | git apply |
| 26 | + git status |
| 27 | + rm bin/cache/flutter_tools.stamp bin/cache/flutter_tools.snapshot |
| 28 | + - name: Install direnv |
| 29 | + run: | |
| 30 | + curl -sfL https://direnv.net/install.sh | bash |
| 31 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 32 | + # - name: Load environment variables |
| 33 | + # run: | |
| 34 | + # direnv allow . |
| 35 | + # direnv export gha > "$GITHUB_ENV" |
| 36 | + |
| 37 | + # # Codegen |
| 38 | + # - name: Run codegen |
| 39 | + # run: melos run codegen |
| 40 | + # - name: Ensure there are no diffs from codegen |
| 41 | + # run: git diff --exit-code |
| 42 | + |
| 43 | + # # Rust |
| 44 | + # - name: Rust format |
| 45 | + # run: cargo fmt --all --check |
| 46 | + # - name: Rust lint |
| 47 | + # run: cargo clippy -- -D warnings |
| 48 | + # - name: Rust tests |
| 49 | + # run: cargo test |
| 50 | + |
| 51 | + # # Dart/Flutter |
| 52 | + # - name: Dart format |
| 53 | + # run: dart format --set-exit-if-changed . |
| 54 | + # - name: Dart lint |
| 55 | + # run: flutter analyze --fatal-infos --fatal-warnings |
| 56 | + # - name: Dart tests |
| 57 | + # run: melos run test |
| 58 | + |
| 59 | + # macos_integration_test: |
| 60 | + # runs-on: macos-latest |
| 61 | + # steps: |
| 62 | + # - uses: actions/checkout@v5 |
| 63 | + # - uses: subosito/flutter-action@v2 |
| 64 | + # with: |
| 65 | + # channel: beta # TODO remove |
| 66 | + # - name: Create macOS boilerplate |
| 67 | + # working-directory: packages/flutter_mimir/example |
| 68 | + # run: flutter create . --platforms=macos |
| 69 | + # - name: Disable macOS App Sandbox |
| 70 | + # working-directory: packages/flutter_mimir/example |
| 71 | + # run: /usr/libexec/PlistBuddy -c "Delete :com.apple.security.app-sandbox" macos/Runner/DebugProfile.entitlements |
| 72 | + # - name: Run Flutter integration tests |
| 73 | + # working-directory: packages/flutter_mimir/example |
| 74 | + # run: flutter test -d macos integration_test |
| 75 | + |
| 76 | + # windows_integration_test: |
| 77 | + # runs-on: windows-latest |
| 78 | + # steps: |
| 79 | + # - uses: actions/checkout@v5 |
| 80 | + # - uses: subosito/flutter-action@v2 |
| 81 | + # with: |
| 82 | + # channel: beta # TODO remove |
| 83 | + # - name: Create Windows boilerplate |
| 84 | + # working-directory: packages/flutter_mimir/example |
| 85 | + # run: flutter create . --platforms=windows |
| 86 | + # - name: Run Flutter integration tests |
| 87 | + # working-directory: packages/flutter_mimir/example |
| 88 | + # run: flutter test -d windows integration_test |
| 89 | + |
| 90 | + # linux_integration_test: |
| 91 | + # runs-on: ubuntu-latest |
| 92 | + # steps: |
| 93 | + # - uses: actions/checkout@v5 |
| 94 | + # - uses: subosito/flutter-action@v2 |
| 95 | + # with: |
| 96 | + # channel: beta # TODO remove |
| 97 | + # - uses: pyvista/setup-headless-display-action@v3 |
| 98 | + # - name: Install dependencies for flutter integration test |
| 99 | + # run: sudo apt update && sudo apt-get install -y libglu1-mesa ninja-build clang cmake pkg-config libgtk-3-dev liblzma-dev |
| 100 | + # - name: Create Linux boilerplate |
| 101 | + # working-directory: packages/flutter_mimir/example |
| 102 | + # run: flutter create . --platforms=linux |
| 103 | + # - name: Run Flutter integration tests |
| 104 | + # working-directory: packages/flutter_mimir/example |
| 105 | + # run: flutter test -d linux integration_test |
| 106 | + |
| 107 | + # ios_integration_test: |
| 108 | + # runs-on: macos-latest |
| 109 | + # steps: |
| 110 | + # - uses: actions/checkout@v5 |
| 111 | + # - uses: subosito/flutter-action@v2 |
| 112 | + # with: |
| 113 | + # channel: beta # TODO remove |
| 114 | + # - name: Start iOS Simulator |
| 115 | + # uses: futureware-tech/simulator-action@v4 |
| 116 | + # id: start_simulator |
| 117 | + # with: |
| 118 | + # wait_for_boot: true |
| 119 | + # - name: Create iOS boilerplate |
| 120 | + # working-directory: packages/flutter_mimir/example |
| 121 | + # run: flutter create . --platforms=ios |
| 122 | + # - name: Run Flutter integration tests # NOTE: we often get timeouts otherwise |
| 123 | + # uses: Wandalen/wretry.action@v3 |
| 124 | + # with: |
| 125 | + # attempt_limit: 5 |
| 126 | + # current_path: packages/flutter_mimir/example |
| 127 | + # command: flutter test -d ${{ steps.start_simulator.outputs.udid }} integration_test |
| 128 | + |
| 129 | + # android_integration_test: |
| 130 | + # runs-on: ubuntu-latest |
| 131 | + # steps: |
| 132 | + # - uses: actions/checkout@v5 |
| 133 | + # - uses: subosito/flutter-action@v2 |
| 134 | + # with: |
| 135 | + # channel: beta # TODO remove |
| 136 | + # - name: Create Android boilerplate |
| 137 | + # working-directory: packages/flutter_mimir/example |
| 138 | + # run: flutter create . --platforms=android |
| 139 | + # - name: Enable KVM for Android emulator |
| 140 | + # run: | |
| 141 | + # echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules |
| 142 | + # sudo udevadm control --reload-rules |
| 143 | + # sudo udevadm trigger --name-match=kvm |
| 144 | + # - name: Run Flutter integration tests |
| 145 | + # uses: reactivecircus/android-emulator-runner@v2 |
| 146 | + # with: |
| 147 | + # api-level: 35 |
| 148 | + # target: default |
| 149 | + # arch: x86_64 |
| 150 | + # ram-size: 1024M |
| 151 | + # disk-size: 2048M |
| 152 | + # working-directory: packages/flutter_mimir/example |
| 153 | + # script: flutter test -d `flutter devices | grep android | tr ' ' '\n' | grep emulator-` integration_test |
0 commit comments