Skip to content

Commit

Permalink
Version 9 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaffaKetchup authored Apr 11, 2024
1 parent f78df7a commit ae1f0f5
Show file tree
Hide file tree
Showing 235 changed files with 14,951 additions and 12,712 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/delete_old_runs.yml

This file was deleted.

256 changes: 171 additions & 85 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,175 @@
name: Analyse & Build
on: [push, workflow_dispatch]
name: CI/CD
on:
push:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
package-analysis:
name: "Analyse Package"
runs-on: ubuntu-latest
if: github.event.head_commit.message != 'Built Example Applications'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Dart Package Analyser
uses: axel-op/dart-package-analyzer@v3
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check Package Scores
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
if (( $TOTAL < $TOTAL_MAX ))
then
echo Total score below expected minimum score. Improve the score!
exit 1
fi
score-package:
name: "Score Package"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Run Dart Package Analyser
uses: axel-op/dart-package-analyzer@master
id: analysis
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Check Package Scores
env:
TOTAL: ${{ steps.analysis.outputs.total }}
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }}
run: |
if (( $TOTAL < $TOTAL_MAX ))
then
echo Package score less than available score. Improve the score!
exit 1
fi
analyse-code:
name: "Analyse Code"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Flutter Environment
uses: subosito/flutter-action@main
with:
channel: "beta"
- name: Get Package Dependencies
run: flutter pub get
- name: Get Example Dependencies
run: flutter pub get -C example
- name: Get Test Tile Server Dependencies
run: dart pub get -C tile_server
- name: Check Formatting
run: dart format --output=none --set-exit-if-changed .
- name: Check Lints
run: dart analyze --fatal-warnings

run-tests:
name: "Run Tests"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Flutter Environment
uses: subosito/flutter-action@main
with:
channel: "beta"
- name: Get Dependencies
run: flutter pub get
- name: Install ObjectBox Libs For Testing
run: cd test && bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh) --quiet
- name: Run Tests
run: flutter test -r expanded

content-analysis:
name: "Analyse Contents"
runs-on: ubuntu-latest
if: github.event.head_commit.message != 'Built Example Applications'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Get All Dependencies
run: flutter pub get
- name: Check Formatting
run: dart format --output=none --set-exit-if-changed .
- name: Check Lints
run: dart analyze --fatal-infos --fatal-warnings
build-demo-android:
name: "Build Demo App (Android)"
runs-on: ubuntu-latest
needs: [analyse-code, run-tests]
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Java 17 Environment
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Flutter Environment
uses: subosito/flutter-action@main
with:
channel: "beta"
- name: Build
run: flutter build apk --obfuscate --split-debug-info=./symbols
- name: Upload Artifact
uses: actions/[email protected]
with:
name: android-demo
path: example/build/app/outputs/apk/release
if-no-files-found: error

build-example:
name: "Build Example Applications"
runs-on: windows-latest
needs: [content-analysis, package-analysis]
if: github.event.head_commit.message != 'Built Example Applications'
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Java 17 Environment
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Remove Existing Prebuilt Applications
run: Remove-Item "prebuiltExampleApplications" -Recurse -ErrorAction Ignore
working-directory: .
- name: Create Prebuilt Applications (Output) Directory
run: md prebuiltExampleApplications
working-directory: .
- name: Get All Dependencies
run: flutter pub get
- name: Build Android Application
run: flutter build apk --obfuscate --split-debug-info=/symbols
- name: Move Android Application To Output Directory
run: move "example\build\app\outputs\flutter-apk\app-release.apk" "prebuiltExampleApplications\AndroidApplication.apk"
working-directory: .
- name: Build Windows Application
run: flutter build windows --obfuscate --split-debug-info=/symbols
- name: Create Windows Application Installer
run: iscc "windowsApplicationInstallerSetup.iss"
working-directory: .
- name: Commit Output Directory
uses: EndBug/[email protected]
with:
message: "Built Example Applications"
add: "prebuiltExampleApplications/"
default_author: github_actions
build-demo-windows:
name: "Build Demo App (Windows)"
runs-on: windows-latest
needs: [analyse-code, run-tests]
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Flutter Environment
uses: subosito/flutter-action@main
with:
channel: "beta"
- name: Build
run: flutter build windows --obfuscate --split-debug-info=./symbols
- name: Create Installer
run: iscc "windowsApplicationInstallerSetup.iss"
working-directory: .
- name: Upload Artifact
uses: actions/[email protected]
with:
name: windows-demo
path: windowsTemp/WindowsApplication.exe
if-no-files-found: error

build-tile-server-windows:
name: "Build Tile Server (Windows)"
runs-on: windows-latest
needs: [analyse-code, run-tests]
defaults:
run:
working-directory: ./tile_server
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Dart Environment
uses: dart-lang/[email protected]
- name: Get Dependencies
run: dart pub get
- name: Get Dart Dependencies
run: dart pub get
- name: Generate Tile Images
run: dart run bin/generate_dart_images.dart
- name: Compile
run: dart compile exe bin/tile_server.dart
- name: Upload Artifact
uses: actions/[email protected]
with:
name: windows-ts
path: tile_server/bin/tile_server.exe
if-no-files-found: error

build-tile-server-linux:
name: "Build Tile Server (Linux/Ubuntu)"
runs-on: ubuntu-latest
needs: [analyse-code, run-tests]
defaults:
run:
working-directory: ./tile_server
steps:
- name: Checkout Repository
uses: actions/checkout@master
- name: Setup Dart Environment
uses: dart-lang/[email protected]
- name: Get Dependencies
run: dart pub get
- name: Run Pre-Compile Generator
run: dart run bin/generate_dart_images.dart
- name: Compile
run: dart compile exe bin/tile_server.dart
- name: Upload Artifact
uses: actions/[email protected]
with:
name: linux-ts
path: tile_server/bin/tile_server.exe
if-no-files-found: error
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Custom
local/
.fvm/
test/lib/

# Miscellaneous
*.class
Expand Down
1 change: 0 additions & 1 deletion .pubignore

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "Run Example App",
"name": "Run Demo App",
"request": "launch",
"type": "dart",
"program": "example/lib/main.dart"
Expand Down
6 changes: 0 additions & 6 deletions .vscode/settings.json

This file was deleted.

10 changes: 4 additions & 6 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
"version": "2.0.0",
"tasks": [
{
"type": "flutter",
"command": "flutter",
"type": "dart",
"command": "dart",
"args": [
"pub",
"run",
"build_runner",
"build",
"--delete-conflicting-outputs"
"build"
],
"problemMatcher": [
"$dart-build_runner"
],
"group": "build",
"label": "Run Code Generator",
"detail": "flutter pub run build_runner build"
"detail": "dart run build_runner build"
}
]
}
Loading

0 comments on commit ae1f0f5

Please sign in to comment.