-
Notifications
You must be signed in to change notification settings - Fork 856
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(workflows): customizable workflows (#1356)
* ability to trigger each job individually via workflow_dispatch * categorize reusable workflows / jobs into `build` and `test` * split trigger into `pull-request` and `release`
- Loading branch information
Showing
4 changed files
with
267 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
name: build | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
enable_android: | ||
description: 'Build Android' | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_web: | ||
description: 'Build Web' | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_ios: | ||
description: 'Build IOS' | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_windows: | ||
description: 'Build Windows' | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_linux: | ||
description: 'Build Linux' | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_macos: | ||
description: 'Build MacOS' | ||
required: false | ||
default: true | ||
type: boolean | ||
workflow_call: | ||
inputs: | ||
enable_android: | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_web: | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_ios: | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_windows: | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_linux: | ||
required: false | ||
default: true | ||
type: boolean | ||
enable_macos: | ||
required: false | ||
default: true | ||
type: boolean | ||
|
||
jobs: | ||
web: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
if: inputs.enable_web | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: subosito/flutter-action@v2 | ||
- uses: bluefireteam/melos-action@main | ||
|
||
- name: Example app - Build Web app | ||
working-directory: ./packages/audioplayers/example | ||
run: flutter build web | ||
|
||
android: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
if: inputs.enable_android | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Setup Android SDK | ||
uses: android-actions/setup-android@v2 | ||
|
||
- uses: subosito/flutter-action@v2 | ||
- uses: bluefireteam/melos-action@main | ||
|
||
- name: Example App - Build Android APK | ||
working-directory: ./packages/audioplayers/example | ||
run: flutter build apk --release | ||
|
||
- name: Run Android unit tests | ||
working-directory: ./packages/audioplayers/example/android | ||
run: ./gradlew test | ||
|
||
ios: | ||
runs-on: macOS-latest | ||
timeout-minutes: 30 | ||
if: inputs.enable_ios | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: subosito/flutter-action@v2 | ||
- uses: bluefireteam/melos-action@main | ||
|
||
- name: Example app - Build iOS | ||
working-directory: ./packages/audioplayers/example | ||
run: flutter build ios --release --no-codesign | ||
|
||
macos: | ||
runs-on: macOS-latest | ||
timeout-minutes: 30 | ||
if: inputs.enable_macos | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: subosito/flutter-action@v2 | ||
- uses: bluefireteam/melos-action@main | ||
|
||
- name: setup-cocoapods | ||
uses: maxim-lobanov/setup-cocoapods@v1 | ||
with: | ||
podfile-path: ./packages/audioplayers/example/macos/Podfile.lock | ||
- name: Example app - Build macOS | ||
working-directory: ./packages/audioplayers/example | ||
run: flutter build macos --release | ||
|
||
windows: | ||
runs-on: windows-latest | ||
timeout-minutes: 30 | ||
if: inputs.enable_windows | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: subosito/flutter-action@v2 | ||
- uses: bluefireteam/melos-action@main | ||
|
||
- name: Example app - Build Windows app | ||
working-directory: ./packages/audioplayers/example | ||
run: flutter build windows --release | ||
|
||
linux: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
if: inputs.enable_linux | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: subosito/flutter-action@v2 | ||
- uses: bluefireteam/melos-action@main | ||
|
||
- name: Install Flutter requirements for Linux | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev | ||
- name: Install GStreamer | ||
# Install libunwind-dev, see https://github.com/actions/runner-images/issues/6399#issuecomment-1285011525 | ||
run: | | ||
sudo apt install -y libunwind-dev | ||
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev | ||
- name: Example app - Build Linux app | ||
working-directory: ./packages/audioplayers/example | ||
run: flutter build linux --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: pull-request | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
|
||
jobs: | ||
call-test: | ||
uses: ./.github/workflows/test.yml | ||
if: github.event.pull_request.draft == false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
call-build: | ||
uses: ./.github/workflows/build.yml | ||
|
||
call-test: | ||
needs: call-build | ||
uses: ./.github/workflows/test.yml |
Oops, something went wrong.