Skip to content

Commit

Permalink
[gh] restructure wf files
Browse files Browse the repository at this point in the history
  • Loading branch information
dreautall committed Feb 24, 2024
1 parent 64f3303 commit 8888401
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 45 deletions.
48 changes: 5 additions & 43 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,20 @@ name: Check

on:
push:
workflow_call:
inputs:
external_call:
description: 'To distinguish workflow_call from regular push'
type: boolean
required: false
default: true

jobs:
setup_env:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Setup the Java environment.
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{vars.JAVA_VERSION}}
cache: 'gradle'

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

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

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

# Get flutter dependencies.
- run: flutter pub get

analyze:
runs-on: ubuntu-latest
needs: [setup_env]

steps:
# Call setup_env workflow to setup workspace
- uses: ./.github/workflows/setup_env.yml

# Check for any formatting issues in the code.
- run: dart format --set-exit-if-changed .

# Statically analyze the Dart code for any errors.
- run: dart analyze .

# test:
# runs-on: ubuntu-latest
# needs: [analyze]
#
# steps:
# # Run widget tests for our flutter project.
# - run: flutter test
# Run widget tests for our flutter project.
# - run: flutter test
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
runs-on: ubuntu-latest

steps:
# Call Commit workflow to setup workspace
- uses: ./.github/workflows/commit.yml
# Call setup_env workflow to setup workspace
- uses: ./.github/workflows/setup_env.yml

# Generate keystore
- uses: timheuer/[email protected]
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/setup_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Setup ENV

on:
workflow_call:

jobs:
setup_env:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Setup the Java environment.
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{vars.JAVA_VERSION}}
cache: 'gradle'

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

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

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

# Get flutter dependencies.
- run: flutter pub get

0 comments on commit 8888401

Please sign in to comment.