From e3407994124949f192dc656f8b5ba34a28fef238 Mon Sep 17 00:00:00 2001 From: Socheat Sok Date: Fri, 13 Dec 2024 17:47:31 +0700 Subject: [PATCH] Rework test workflows --- .github/workflows/flutter-linux.yml | 42 ++++++++++++ .github/workflows/flutter-macos-intel.yml | 42 ++++++++++++ .github/workflows/flutter-macos.yml | 42 ++++++++++++ .github/workflows/flutter-windows.yml | 42 ++++++++++++ .github/workflows/flutter.yml | 79 ++++++----------------- README.md | 5 +- 6 files changed, 192 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/flutter-linux.yml create mode 100644 .github/workflows/flutter-macos-intel.yml create mode 100644 .github/workflows/flutter-macos.yml create mode 100644 .github/workflows/flutter-windows.yml diff --git a/.github/workflows/flutter-linux.yml b/.github/workflows/flutter-linux.yml new file mode 100644 index 0000000..d992629 --- /dev/null +++ b/.github/workflows/flutter-linux.yml @@ -0,0 +1,42 @@ +name: Flutter SDK for Linux + +on: + push: + branches: [main, v*] + pull_request: + branches: [main, v*] + schedule: + # https://crontab.guru/#40_10_*_*_* + - cron: '40 10 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + stable: + uses: ./.github/workflows/flutter.yml + strategy: + fail-fast: false + matrix: + version: + - latest + - 3.27.0 + with: + runs-on: ubuntu-latest + channel: stable + version: ${{ matrix.version }} + + beta: + uses: ./.github/workflows/flutter.yml + strategy: + fail-fast: false + matrix: + version: + - latest + - 3.27.0-0.1.pre + with: + runs-on: ubuntu-latest + channel: beta + version: ${{ matrix.version }} diff --git a/.github/workflows/flutter-macos-intel.yml b/.github/workflows/flutter-macos-intel.yml new file mode 100644 index 0000000..06dadcf --- /dev/null +++ b/.github/workflows/flutter-macos-intel.yml @@ -0,0 +1,42 @@ +name: Flutter SDK for macOS (Intel) + +on: + push: + branches: [main, v*] + pull_request: + branches: [main, v*] + schedule: + # https://crontab.guru/#40_10_*_*_* + - cron: '40 10 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + stable: + uses: ./.github/workflows/flutter.yml + strategy: + fail-fast: false + matrix: + version: + - latest + - 3.27.0 + with: + runs-on: macos-13 # Intel Mac + channel: stable + version: ${{ matrix.version }} + + beta: + uses: ./.github/workflows/flutter.yml + strategy: + fail-fast: false + matrix: + version: + - latest + - 3.27.0-0.1.pre + with: + runs-on: macos-13 # Intel Mac + channel: beta + version: ${{ matrix.version }} diff --git a/.github/workflows/flutter-macos.yml b/.github/workflows/flutter-macos.yml new file mode 100644 index 0000000..1c651ce --- /dev/null +++ b/.github/workflows/flutter-macos.yml @@ -0,0 +1,42 @@ +name: Flutter SDK for macOS + +on: + push: + branches: [main, v*] + pull_request: + branches: [main, v*] + schedule: + # https://crontab.guru/#40_10_*_*_* + - cron: '40 10 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + stable: + uses: ./.github/workflows/flutter.yml + strategy: + fail-fast: false + matrix: + version: + - latest + - 3.27.0 + with: + runs-on: macos-latest # Apple Silicon Mac + channel: stable + version: ${{ matrix.version }} + + beta: + uses: ./.github/workflows/flutter.yml + strategy: + fail-fast: false + matrix: + version: + - latest + - 3.27.0-0.1.pre + with: + runs-on: macos-latest # Apple Silicon Mac + channel: beta + version: ${{ matrix.version }} diff --git a/.github/workflows/flutter-windows.yml b/.github/workflows/flutter-windows.yml new file mode 100644 index 0000000..da48813 --- /dev/null +++ b/.github/workflows/flutter-windows.yml @@ -0,0 +1,42 @@ +name: Flutter SDK for Windows + +on: + push: + branches: [main, v*] + pull_request: + branches: [main, v*] + schedule: + # https://crontab.guru/#40_10_*_*_* + - cron: '40 10 * * *' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + stable: + uses: ./.github/workflows/flutter.yml + strategy: + fail-fast: false + matrix: + version: + - latest + - 3.27.0 + with: + runs-on: windows-latest + channel: stable + version: ${{ matrix.version }} + + beta: + uses: ./.github/workflows/flutter.yml + strategy: + fail-fast: false + matrix: + version: + - latest + - 3.27.0-0.1.pre + with: + runs-on: windows-latest + channel: beta + version: ${{ matrix.version }} diff --git a/.github/workflows/flutter.yml b/.github/workflows/flutter.yml index 05cf1f1..ac984b7 100644 --- a/.github/workflows/flutter.yml +++ b/.github/workflows/flutter.yml @@ -1,73 +1,34 @@ name: Flutter on: - push: - branches: [main, v*] - pull_request: - branches: [main, v*] - schedule: - # https://crontab.guru/#40_10_*_*_* - - cron: '40 10 * * *' - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + workflow_call: + inputs: + runs-on: + description: 'Operating system' + required: true + default: 'ubuntu-latest' + type: string + channel: + description: 'Flutter channel' + required: true + default: 'stable' + type: string + version: + description: 'Flutter version' + required: true + default: 'latest' + type: string jobs: stable: - runs-on: ${{ matrix.runs-on }} - strategy: - fail-fast: false - matrix: - runs-on: - - ubuntu-latest - - windows-latest - - macos-latest # Apple M1 Silicon - - macos-13 # Intel macOS - version: - - latest - - 3.27.0 - steps: - - uses: actions/checkout@v4 - - - uses: ./ - with: - version: ${{ matrix.version }} - channel: stable - - - name: Dart version - run: dart --version - - name: Flutter version - run: flutter --version - - name: Flutter doctor - run: flutter doctor - - - name: Run hello world - run: | - echo "main() { print('hello world'); }" > hello.dart - dart hello.dart - - beta: - runs-on: ${{ matrix.runs-on }} - strategy: - fail-fast: false - matrix: - runs-on: - - ubuntu-latest - - windows-latest - - macos-latest # Apple M1 Silicon - - macos-13 # Intel macOS - version: - - latest - - 3.27.0-0.1.pre + runs-on: ${{ inputs.runs-on }} steps: - uses: actions/checkout@v4 - uses: ./ with: - version: ${{ matrix.version }} - channel: beta + channel: ${{ inputs.channel }} + version: ${{ inputs.version }} - name: Dart version run: dart --version diff --git a/README.md b/README.md index da45cb7..399ed2e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,10 @@ This [GitHub Action] installs and sets up of a Flutter SDK for use in actions by * Support for caching the Flutter SDK and pub dependencies * Support for automated publishing of packages to [Pub.dev] -[![Flutter](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter.yml/badge.svg)](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter.yml) +[![Flutter SDK for Windows](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter-windows.yml/badge.svg)](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter-windows.yml) +[![Flutter SDK for Linux](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter-linux.yml/badge.svg)](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter-linux.yml) +[![Flutter SDK for macOS](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter-macos.yml/badge.svg)](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter-macos.yml) +[![Flutter SDK for macOS (Intel)](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter-macos-intel.yml/badge.svg)](https://github.com/flutter-actions/setup-flutter/actions/workflows/flutter-macos-intel.yml) ## Inputs