From ad01c1cf2dfdaa5d563b686622bc57b8620e3b5a 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 ++++++----------------- 5 files changed, 188 insertions(+), 59 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..009ef1f --- /dev/null +++ b/.github/workflows/flutter-macos.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-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..73fcc90 --- /dev/null +++ b/.github/workflows/flutter-windows.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: 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