Skip to content

This GitHub Action installs and setup of a Flutter SDK

License

Notifications You must be signed in to change notification settings

Hitask/setup-flutter-a

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This GitHub Action installs and sets up of a Flutter SDK for use in actions by:

  • Downloading the Flutter SDK
  • Adding the flutter command and dart command to path

Flutter

Inputs

The action takes the following inputs:

  • channel: (Required) A release channel, which will install the latest build from that channel. Available channels are stable, beta. See https://flutter.dev/docs/development/tools/sdk/releases for details.

  • version: (Required) A specific SDK version, e.g. 3.0.2 or 3.1.0-9.0.pre

  • cache: (Optional) Enable cache of the installed Flutter SDK. Default: false

  • cache-key: (Optional) An explicit key for restoring and saving the Flutter SDK to/from cache

Basic example

Install the latest stable SDK, and run Hello World.

name: Flutter

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Setup Flutter SDK
        uses: flutter-actions/setup-flutter@v2
        with:
          channel: stable
          version: 3.0.2

      - name: Install dependencies
        run: flutter pub get

      - name: Analyze project source
        run: dart analyze

      - name: Run tests
        run: flutter test

Working with Android project:

name: Flutter for Android

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Set up JDK 1.8
        uses: actions/setup-java@v1
        with:
          java-version: 1.8

      - name: Setup Android SDK
        uses: android-actions/setup-android@v2

      - name: Setup Flutter SDK
        uses: flutter-actions/setup-flutter@v2
        with:
          channel: stable
          version: 3.0.2

      - name: Install dependencies
        run: flutter pub get

      - name: Analyze project source
        run: dart analyze

      - name: Run tests
        run: flutter test

Troubleshooting

Apple Silicon

If you are running this on self-hosted runner specially with Apple Silicon Mac only Flutter SDK v3.0.0 or later are supported.

For more information plase check https://docs.flutter.dev/get-started/install/macos.

License

See the LICENSE file.

About

This GitHub Action installs and setup of a Flutter SDK

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%