Skip to content

Commit

Permalink
Simplify workflows (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaffaKetchup authored Jul 25, 2023
1 parent cd13d55 commit 18adc5b
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 182 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/analyse-test.yml

This file was deleted.

141 changes: 141 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: "Branch & Fork CI/CD"
on:
push:
branches:
- '!master'
pull_request:
workflow_dispatch:

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

jobs:
score-package:
name: "Score Package"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- 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@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

run-tests:
name: "Run Tests"
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Run Tests
run: flutter test -r expanded

build-android:
name: "Build Android Example App"
runs-on: ubuntu-latest
needs: [run-tests, analyse-code, score-package]
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: Build Android Application
run: flutter build apk
- name: Archive Artifact
uses: actions/[email protected]
with:
name: apk-build
path: example/build/app/outputs/apk/release
if-no-files-found: error

build-windows:
name: "Build Windows Example App"
runs-on: windows-latest
needs: [run-tests, analyse-code, score-package]
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Build Windows Application
run: flutter build windows
- name: Create Windows Application Installer
run: iscc "windowsApplicationInstallerSetup.iss"
working-directory: .
- name: Archive Artifact
uses: actions/[email protected]
with:
name: exe-build
path: windowsTemp/WindowsApplication.exe
if-no-files-found: error

build-web:
name: "Build Web Example App"
runs-on: ubuntu-latest
needs: [run-tests, analyse-code, score-package]
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Build Web Application
run: flutter build web --web-renderer canvaskit
- name: Archive Artifact
uses: actions/[email protected]
with:
name: web-build
path: example/build/web
if-no-files-found: error
51 changes: 45 additions & 6 deletions .github/workflows/build-io.yml → .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: Build IO Example Apps
name: "'fleaflet/flutter_map' 'master' CI/CD"
on:
workflow_call:
push:
branches:
- master
workflow_dispatch:

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

jobs:
build-android:
name: "Android"
name: "Build Android Example App"
runs-on: ubuntu-latest
if: github.repository == 'fleaflet/flutter_map'
defaults:
run:
working-directory: ./example
Expand All @@ -29,10 +37,11 @@ jobs:
name: apk-build
path: example/build/app/outputs/apk/release
if-no-files-found: error

build-windows:
name: "Windows"
name: "Build Windows Example App"
runs-on: windows-latest
if: github.repository == 'fleaflet/flutter_map'
defaults:
run:
working-directory: ./example
Expand All @@ -53,4 +62,34 @@ jobs:
with:
name: exe-build
path: windowsTemp/WindowsApplication.exe
if-no-files-found: error
if-no-files-found: error

build-web:
name: "Build & Deploy Web Example App"
runs-on: ubuntu-latest
if: github.repository == 'fleaflet/flutter_map'
defaults:
run:
working-directory: ./example
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Flutter Environment
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Build Web Application
run: flutter build web --web-renderer canvaskit
- name: Archive Artifact
uses: actions/[email protected]
with:
name: web-build
path: example/build/web
if-no-files-found: error
- name: Publish Live Web App
uses: FirebaseExtended/action-hosting-deploy@main
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_FLEAFLET }}"
channelId: live
projectId: fleaflet-firebase
48 changes: 0 additions & 48 deletions .github/workflows/pr.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/publish.yml

This file was deleted.

54 changes: 0 additions & 54 deletions .github/workflows/push.yml

This file was deleted.

Loading

0 comments on commit 18adc5b

Please sign in to comment.