204 lines
7.0 KiB
YAML
204 lines
7.0 KiB
YAML
name: Dart
|
|
|
|
on:
|
|
push:
|
|
branches: [ "develop" ]
|
|
pull_request:
|
|
branches: [ "develop" ]
|
|
|
|
jobs:
|
|
compile-web-wasm:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup CMake
|
|
uses: jwlawson/actions-setup-cmake@v2
|
|
with:
|
|
cmake-version: '3.25.0' # or 'latest'
|
|
- name: Setup Emscripten
|
|
uses: mymindstorm/setup-emsdk@v14
|
|
with:
|
|
version: 'latest'
|
|
- name: Compile web
|
|
run: make wasm
|
|
dart-tests:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/setup-build-env
|
|
- run: |
|
|
cd thermion_dart
|
|
dart pub get
|
|
xvfb-run dart --enable-experiment=native-assets test \
|
|
test/asset_tests.dart \
|
|
test/instancing_tests.dart \
|
|
test/light_tests.dart \
|
|
test/entity_tests.dart \
|
|
test/geometry_tests.dart \
|
|
test/view_tests.dart \
|
|
test/postprocessing_tests.dart \
|
|
test/scene_tests.dart \
|
|
test/picking_tests.dart \
|
|
--concurrency=1
|
|
#test/overlay_tests.dart \
|
|
- name: Zip output
|
|
run: zip -r output.zip ./thermion_dart/test/output
|
|
- name: Upload test output
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: golden-images-${{ github.sha }}
|
|
path: output.zip
|
|
- name: Download golden images from previous run
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh run download 15990504915 \
|
|
--name golden-images-4b9870244a529bf086280331d38c55e294425b4f \
|
|
--dir ./thermion_dart/test/golden-downloads
|
|
- name: Unzip golden images
|
|
run: |
|
|
cd thermion_dart/test/golden-downloads && unzip output.zip
|
|
- name: Install Python dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install Pillow numpy
|
|
- name: Compare golden images
|
|
run: cd thermion_dart/test && python compare_goldens.py
|
|
- name: Upload logs
|
|
if: failure() || steps.build.outcome == 'failure'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-logs
|
|
path: |
|
|
${{ github.workspace }}/thermion_dart/.dart_tool/thermion_dart/log/build.log
|
|
retention-days: 5
|
|
flutter_examples:
|
|
name: flutter_examples
|
|
runs-on: macos-latest
|
|
defaults:
|
|
run:
|
|
working-directory: examples/flutter
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: master
|
|
architecture: ARM64
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
- name: Install Android SDK
|
|
uses: android-actions/setup-android@v3
|
|
with:
|
|
api-level: 34
|
|
build-tools: 34.0.0
|
|
cmake-version: 3.22.1
|
|
ndk-version: 25.1.893739
|
|
- name: Accept Android SDK licenses
|
|
run: |
|
|
yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --licenses
|
|
- run: cd quickstart && flutter pub get && flutter build macos
|
|
# - run: cd quickstart && flutter pub get && flutter build ios
|
|
- run: cd quickstart && flutter pub get && flutter build appbundle
|
|
- run: cd quickstart && flutter build web
|
|
- run: cd picking && flutter pub get && flutter build macos
|
|
# - run: cd picking && flutter pub get && flutter build ios
|
|
- run: cd picking && flutter pub get && flutter build appbundle
|
|
- run: cd picking && flutter build web
|
|
- name: Upload logs
|
|
if: failure() || steps.build.outcome == 'failure'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-logs
|
|
path: |
|
|
# D:\a\thermion\thermion\thermion_dart\.dart_tool\thermion_dart\log\build.log
|
|
/Users/runner/work/thermion/thermion/thermion_dart/.dart_tool/thermion_dart/log/build.log
|
|
retention-days: 5
|
|
flutter_examples_windows:
|
|
name: flutter_examples_windows
|
|
runs-on: windows-latest
|
|
defaults:
|
|
run:
|
|
working-directory: examples/flutter
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: master
|
|
- run: cd quickstart && flutter pub get && flutter build windows
|
|
- run: cd picking && flutter pub get && flutter build windows
|
|
- name: Upload logs
|
|
if: failure() || steps.build.outcome == 'failure'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build-logs
|
|
path: |
|
|
D:\a\thermion\thermion\thermion_dart\.dart_tool\thermion_dart\log\build.log
|
|
retention-days: 5
|
|
# thermion_dart:
|
|
# name: thermion_dart
|
|
# runs-on: macos-latest
|
|
# defaults:
|
|
# run:
|
|
# working-directory: thermion_dart
|
|
# steps:
|
|
# - uses: actions/checkout@v4
|
|
# - name: Set up Flutter
|
|
# uses: subosito/flutter-action@v2
|
|
# with:
|
|
# channel: master
|
|
# - run: flutter pub get
|
|
# - run: dart --enable-experiment=native-assets test -j1 test/light_tests.dart
|
|
# thermion_flutter:
|
|
# name: thermion_flutter
|
|
# runs-on: macos-13
|
|
# defaults:
|
|
# run:
|
|
# working-directory: thermion_flutter/thermion_flutter # Adjust this path
|
|
# steps:
|
|
# - uses: actions/checkout@v4
|
|
# - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603
|
|
# - name: Install dependencies
|
|
# run: dart pub get
|
|
#
|
|
#
|
|
##- uses: actions/checkout@v4
|
|
#- name: Setup LLVM
|
|
# uses: KyleMayes/install-llvm-action@v1
|
|
# with:
|
|
# version: "16"
|
|
#- name: Add LLVM to PATH
|
|
# run: |
|
|
# echo "${{ github.workspace }}/llvm/bin" >> $GITHUB_PATH
|
|
# echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib/x86_64-unknown-linux-gnu/" >> $GITHUB_ENV
|
|
#- name: Verify installation
|
|
# run: clang --version
|
|
#- name: Install MESA
|
|
# run: |
|
|
# sudo apt-get update
|
|
# sudo apt-get install -y xvfb
|
|
# sudo apt-get install -y libosmesa6-dev
|
|
# #sudo apt-get -y build-dep mesa
|
|
# #git clone https://gitlab.freedesktop.org/mesa/mesa.git
|
|
# #cd mesa
|
|
# #git checkout mesa-23.2.1
|
|
# #mkdir -p out
|
|
# #meson setup builddir/ -Dprefix="$(pwd)/out" -Dosmesa=true -Dglx=xlib -Dgallium-drivers=swrast -Dvulkan-drivers=swrast
|
|
# #meson install -C builddir/
|
|
#- name: Install Vulkan SDK and dependencies
|
|
# run: |
|
|
# wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
|
|
# sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
|
|
# sudo apt-get update
|
|
# sudo apt-get install -y vulkan-sdk
|
|
#- name: Set up Flutter
|
|
# uses: subosito/flutter-action@v2
|
|
# with:
|
|
# channel: master
|
|
# architecture: X64
|
|
|