Skip to content

Add a formatting test CI file #20

Add a formatting test CI file

Add a formatting test CI file #20

Workflow file for this run

name: build-test
on:
push:
branches:
- main
paths-ignore:
- "CHANGELOG.md"
- "LICENSE"
- "README.md"
- "translations/**"
pull_request:
paths-ignore:
- "CHANGELOG.md"
- "LICENSE"
- "README.md"
- "translations/**"
workflow_dispatch:
concurrency:
# Cancels the workflow
# when another event in the same context happens.
# If it's a PR, context is the pull request number.
# Otherwise, it uses the Git reference(branch or tag name).
group: >
${{ github.workflow }}
${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.runner }} / ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false # Important
matrix:
runner: [ubuntu-latest, windows-latest, macos-latest]
target: [android, web] # On all platforms
include:
# Specify targets for each platform
- runner: ubuntu-latest
target: linux
- runner: windows-latest
target: windows
- runner: macos-latest
target: macos
- runner: macos-latest
target: ios
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout submodules
run: git submodule update --init --recursive
# # Automaticallly setup cache (Doesn't work yet)
# - name: Setup Nix
# if: matrix.runner == 'ubuntu-latest' || matrix.runner == 'macos-latest'
# uses: DeterminateSystems/nix-installer-action@main
# - name: Setup Magic Nix Cache
# if: matrix.runner == 'ubuntu-latest' || matrix.runner == 'macos-latest'
# uses: DeterminateSystems/magic-nix-cache-action@main
# - name: Run Nix Flake Check
# if: matrix.runner == 'ubuntu-latest' || matrix.runner == 'macos-latest'
# run: nix flake check
# Manually setup cache
- name: Setup cache
uses: actions/cache@v3
with:
path: |
~/.pub-cache
~/.cargo
~/.gradle
~/.android
/usr/local/lib/android/
./example/build
key: manual-cache-${{ matrix.runner }}
- name: Setup Flutter toolchain
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: "rust-cache"
- name: Setup Ninja and GTK3 toolchain (Only Linux target)
if: matrix.target == 'linux'
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- name: Setup Java toolchain (Only Android target)
if: matrix.target == 'android'
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "11"
cache: "gradle"
- name: Fetch dependencies
working-directory: example/
run: flutter pub get
- name: Build example Flutter app
if: matrix.target == 'linux'
working-directory: example/
run: flutter build linux
- name: Build example Flutter app
if: matrix.target == 'android'
working-directory: example/
run: |
flutter build apk
flutter build appbundle
- name: Build example Flutter app
if: matrix.target == 'windows'
working-directory: example/
run: flutter build windows
- name: Build example Flutter app
if: matrix.target == 'macos'
working-directory: example/
run: flutter build macos
- name: Build example Flutter app
if: matrix.target == 'ios'
working-directory: example/
run: flutter build ios --no-codesign
- name: Build example Flutter app
if: matrix.target == 'web'
working-directory: example/
run: |
dart run rust_in_flutter wasm --release
flutter build web