├── .github └── workflows │ ├── comparison.yml │ └── test.yml ├── LICENSE ├── README.md └── action.yml /.github/workflows/comparison.yml: -------------------------------------------------------------------------------- 1 | name: Comparison 2 | on: 3 | pull_request: 4 | push: 5 | 6 | jobs: 7 | comparison-britannio-action-install-flutter: 8 | runs-on: ${{ matrix.os }} 9 | strategy: 10 | matrix: 11 | os: [ubuntu-latest, macos-latest] 12 | flutter_version: [stable, master] 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Install Flutter 16 | uses: britannio/action-install-flutter@v1 17 | with: 18 | version: stable 19 | - run: flutter --version 20 | comparison-subosito-flutter-action: 21 | runs-on: ${{ matrix.os }} 22 | strategy: 23 | matrix: 24 | os: [ubuntu-latest, macos-latest] 25 | flutter_version: [stable, master] 26 | steps: 27 | - uses: actions/checkout@v2 28 | - name: Install Flutter 29 | uses: subosito/flutter-action@v1 30 | with: 31 | channel: stable 32 | - run: flutter --version 33 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Flutter Workflow 2 | on: 3 | pull_request: 4 | push: 5 | 6 | jobs: 7 | test: 8 | runs-on: ${{ matrix.os }} 9 | strategy: 10 | matrix: 11 | os: [ubuntu-latest, macos-latest] 12 | flutter_version: [stable, master, "2.2.3"] 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Install Flutter 16 | uses: ./ 17 | with: 18 | version: ${{ matrix.flutter_version }} 19 | - run: flutter --version -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Britannio Jarrett 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # action-install-flutter 2 | 3 | This action installs [Flutter](https://flutter.dev) so your workflow can run 4 | Flutter commands like `flutter test`. 5 | 6 | # Inputs 7 | 8 | ## `version` 9 | 10 | By default, the `stable` channel is installed however any Flutter branch or 11 | version tag can be set e.g., `2.2.3`, `master`, `beta`, `dev`. 12 | 13 | We recommend using a fixed version rather than a channel as it allows you to 14 | checkout an old commit and run an action with the version of Flutter used at the 15 | time of the commit. 16 | 17 | # Example 18 | 19 | ```yaml 20 | name: Flutter Workflow 21 | env: 22 | FLUTTER_VERSION: "2.2.3" 23 | on: push 24 | jobs: 25 | test: 26 | name: Run Tests 27 | runs-on: ubuntu-latest 28 | steps: 29 | - uses: actions/checkout@v2 30 | - name: Install Flutter 31 | uses: britannio/action-install-flutter@v1 32 | with: 33 | version: $FLUTTER_VERSION 34 | - name: Get Packages 35 | run: flutter pub get 36 | - name: Run Tests 37 | run: flutter test --no-pub 38 | ``` -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Install Flutter" 2 | author: Britannio Jarrett 3 | description: "Installs Flutter(https://flutter.dev)" 4 | inputs: 5 | version: 6 | description: "The channel/version of Flutter to be used e.g., beta or 2.0.0" 7 | required: false 8 | default: "stable" 9 | runs: 10 | using: "composite" 11 | steps: 12 | - run: | 13 | echo "Installing Flutter from ${{ inputs.version }}" 14 | git clone https://github.com/flutter/flutter.git --depth 1 -b ${{ inputs.version }} "$HOME/flutter" 15 | echo "$HOME/flutter/bin" >> $GITHUB_PATH 16 | echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH 17 | shell: bash 18 | - run: flutter precache 19 | shell: bash 20 | branding: 21 | icon: "smartphone" 22 | color: "purple" 23 | --------------------------------------------------------------------------------