93 lines
2.3 KiB
YAML
93 lines
2.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
analyze-and-test:
|
|
name: Analyze & unit test
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: "3.41.6"
|
|
channel: stable
|
|
cache: true
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Generate Drift code
|
|
run: flutter pub run build_runner build --delete-conflicting-outputs
|
|
|
|
- name: Analyze
|
|
run: flutter analyze --fatal-infos
|
|
|
|
- name: Unit tests
|
|
run: flutter test test/unit/ --coverage
|
|
|
|
- name: Widget tests
|
|
run: flutter test test/widget/
|
|
|
|
integration:
|
|
name: Integration tests (Stalwart)
|
|
runs-on: ubuntu-latest
|
|
# Run integration tests only on push to main, not on every PR,
|
|
# since they require downloading the Stalwart binary via Nix.
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: DeterminateSystems/nix-installer-action@v14
|
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@v8
|
|
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: "3.41.6"
|
|
channel: stable
|
|
cache: true
|
|
|
|
- name: Enter Nix shell and run integration tests
|
|
run: |
|
|
nix develop --command bash -c "
|
|
flutter pub get &&
|
|
flutter pub run build_runner build --delete-conflicting-outputs &&
|
|
stalwart-dev/test.sh
|
|
"
|
|
|
|
build-linux:
|
|
name: Build Linux desktop
|
|
runs-on: ubuntu-latest
|
|
needs: analyze-and-test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install GTK3 and build tools
|
|
run: |
|
|
sudo apt-get update -q
|
|
sudo apt-get install -y --no-install-recommends \
|
|
libgtk-3-dev pkg-config cmake ninja-build clang
|
|
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: "3.41.6"
|
|
channel: stable
|
|
cache: true
|
|
|
|
- name: Install dependencies
|
|
run: flutter pub get
|
|
|
|
- name: Generate Drift code
|
|
run: flutter pub run build_runner build --delete-conflicting-outputs
|
|
|
|
- name: Build Linux release
|
|
run: flutter build linux --release
|