Skip to content

Commit

Permalink
[gh] fix action workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dreautall committed Feb 24, 2024
1 parent 5943e66 commit 1235510
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
18 changes: 14 additions & 4 deletions .github/actions/setup_env/action.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
name: Setup Flutter environment
description: Setup Flutter environment
inputs:
java-version:
description: 'Java Version'
required: true
flutter-channel:
description: 'Flutter Channel'
required: true
runs:
using: "composite"
using: 'composite'
steps:
# Setup the Java environment.
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{vars.JAVA_VERSION}}
java-version: ${{inputs.java-version}}
cache: 'gradle'

# Setup the Flutter environment.
- uses: subosito/flutter-action@v2
with:
channel: ${{vars.FLUTTER_CHANNEL}}
channel: ${{inputs.flutter-channel}}
cache: true

# No dart analytics.
- run: dart --disable-analytics
shell: bash

# No flutter analytics.
- run: flutter config --disable-analytics
shell: bash

# Get flutter dependencies.
- run: flutter pub get
- run: flutter pub get
shell: bash
9 changes: 8 additions & 1 deletion .github/workflows/commit.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Check
name: Syntax Check

on:
push:
# Ignore develop branch, will be triggered by workflow_call in release.yml
branches-ignore:
- develop
workflow_call:

jobs:
analyze:
Expand All @@ -12,6 +16,9 @@ jobs:

# Call setup_env action to setup workspace
- uses: ./.github/actions/setup_env
with:
java-version: ${{ vars.JAVA_VERSION }}
flutter-channel: ${{ vars.FLUTTER_CHANNEL }}

# Check for any formatting issues in the code.
- run: dart format --set-exit-if-changed .
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ env:
PROPERTIES_PATH: "./android/key.properties"

jobs:
check:
uses: ./.github/workflows/commit.yml

build:
runs-on: ubuntu-latest
needs: [check]

steps:
- uses: actions/checkout@v4

# Call setup_env action to setup workspace
- uses: ./.github/actions/setup_env
with:
java-version: ${{ vars.JAVA_VERSION }}
flutter-channel: ${{ vars.FLUTTER_CHANNEL }}

# Generate keystore
- uses: timheuer/[email protected]
Expand Down

0 comments on commit 1235510

Please sign in to comment.