forked from Foxyz/sync_replay_project
74 lines
2.5 KiB
YAML
74 lines
2.5 KiB
YAML
name: ci
|
|
on:
|
|
# Branches only: a release tag points at a commit CI already checked on
|
|
# main, and release.yml builds it.
|
|
push:
|
|
branches: ['**']
|
|
pull_request:
|
|
|
|
jobs:
|
|
core:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dart-lang/setup-dart@v1
|
|
with:
|
|
sdk: stable
|
|
- run: dart pub get
|
|
working-directory: packages/core
|
|
- run: dart analyze
|
|
working-directory: packages/core
|
|
- run: dart test
|
|
working-directory: packages/core
|
|
|
|
server:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dart-lang/setup-dart@v1
|
|
with:
|
|
sdk: stable
|
|
- run: dart pub get
|
|
working-directory: packages/server
|
|
- run: dart analyze
|
|
working-directory: packages/server
|
|
- run: dart test
|
|
working-directory: packages/server
|
|
# Compiling the dedicated server proves it stays Flutter-free.
|
|
- run: mkdir -p build && dart compile exe bin/server.dart -o build/watch-together-server
|
|
working-directory: packages/server
|
|
- run: build/watch-together-server --help
|
|
working-directory: packages/server
|
|
|
|
# The updater's Windows apply path (running exe parked as .old) only
|
|
# means something on real NTFS. Runner notes: see release.yml.
|
|
updater-windows:
|
|
# Not for a "Release v…" commit: release.yml builds it on the same
|
|
# (only) Windows runner, which this job would hold up.
|
|
if: ${{ !startsWith(github.event.head_commit.message, 'Release v') }}
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Checkout
|
|
shell: powershell
|
|
run: |
|
|
git init -q .
|
|
git remote add origin "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY.git"
|
|
git fetch -q origin "$env:GITHUB_SHA"
|
|
if ($LASTEXITCODE) { exit 1 }
|
|
git checkout -q --force FETCH_HEAD
|
|
- name: Setup Flutter
|
|
shell: powershell
|
|
run: powershell -NoProfile -ExecutionPolicy Bypass -File tool/setup_flutter_windows.ps1
|
|
- name: Updater tests
|
|
shell: powershell
|
|
working-directory: packages/core
|
|
run: |
|
|
dart pub get
|
|
if ($LASTEXITCODE) { exit 1 }
|
|
dart test test/updater_test.dart
|
|
# The release build, without publishing: a broken Windows build shows
|
|
# here, not only on a tag.
|
|
- name: Windows build
|
|
shell: powershell
|
|
run: powershell -NoProfile -ExecutionPolicy Bypass -File tool/package_windows.ps1
|