Skip to content

Commit

Permalink
Rework test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
socheatsok78 committed Dec 13, 2024
1 parent 9a30e0e commit ad01c1c
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 59 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/flutter-linux.yml
Original file line number Diff line number Diff line change
@@ -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 }}
42 changes: 42 additions & 0 deletions .github/workflows/flutter-macos-intel.yml
Original file line number Diff line number Diff line change
@@ -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 }}
42 changes: 42 additions & 0 deletions .github/workflows/flutter-macos.yml
Original file line number Diff line number Diff line change
@@ -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 }}
42 changes: 42 additions & 0 deletions .github/workflows/flutter-windows.yml
Original file line number Diff line number Diff line change
@@ -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 }}
79 changes: 20 additions & 59 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit ad01c1c

Please sign in to comment.