From 1726119c3eded3d63cca8b1a0a48976c4b0dbfba Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Sat, 17 Jan 2026 10:48:46 -0500 Subject: [PATCH] Add a Github Action to build code in CI This adds a CI workflow in Github Actions to verify that the flutter builds compile for all supported platforms. I tried adding Windows, but it currently fails, so I excluded it from this initial set. --- .github/workflows/build.yml | 76 +++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8826c55 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,76 @@ +name: Build + +on: + push: + pull_request: + +jobs: + android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: "17" + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + cache: true + - name: Cache Gradle + uses: actions/cache@v4 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('android/gradle/wrapper/gradle-wrapper.properties', 'android/build.gradle', 'android/settings.gradle', 'android/app/build.gradle', 'pubspec.lock') }} + restore-keys: | + ${{ runner.os }}-gradle- + - run: flutter pub get + - run: flutter build apk --release --no-pub + + ios: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + cache: true + - run: flutter pub get + - run: flutter build ios --release --no-codesign --no-pub + + linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + cache: true + - name: Install Linux build deps + run: sudo apt-get update && sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev + - run: flutter pub get + - run: flutter build linux --release --no-pub + + macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + cache: true + - run: flutter pub get + - run: flutter build macos --release --no-pub + + web: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + cache: true + - run: flutter pub get + - run: flutter build web --release --no-pub