Merge pull request #250 from natsuk4ze/optimiza-ci #1109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Runner details on https://github.com/actions/runner-images/tree/main/images | |
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_call: | |
inputs: | |
run_all: | |
type: boolean | |
description: 'Run all jobs regardless of path filters' | |
required: false | |
default: false | |
jobs: | |
cancel: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
filter: | |
runs-on: ubuntu-latest | |
outputs: | |
common_changed: ${{ steps.filter.outputs.common }} | |
windows_changed: ${{ steps.filter.outputs.windows }} | |
macos_changed: ${{ steps.filter.outputs.macos }} | |
ios_changed: ${{ steps.filter.outputs.ios }} | |
android_changed: ${{ steps.filter.outputs.android }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Filter changes | |
id: filter | |
uses: dorny/paths-filter@v3 | |
with: | |
filters: | | |
common: | |
- '**/lib/**' | |
- '**/pubspec.yaml' | |
- '**/pubspec.lock' | |
windows: | |
- '**/windows/**' | |
- '**/ci_windows.yml' | |
macos: | |
- 'darwin/**' | |
- 'example/macos/**' | |
- '**/ci_macos.yml' | |
ios: | |
- 'darwin/**' | |
- 'example/ios/**' | |
- '**/ci_ios.yml' | |
android: | |
- '**/android/**' | |
- '**/ci_android.yml' | |
windows: | |
needs: filter | |
if: ${{ needs.filter.outputs.windows_changed == 'true' || needs.filter.outputs.common_changed == 'true' || inputs.run_all }} | |
uses: ./.github/workflows/ci_windows.yml | |
macos: | |
needs: filter | |
if: ${{ needs.filter.outputs.macos_changed == 'true' || needs.filter.outputs.common_changed == 'true' || inputs.run_all }} | |
uses: ./.github/workflows/ci_macos.yml | |
ios: | |
needs: filter | |
if: ${{ needs.filter.outputs.ios_changed == 'true' || needs.filter.outputs.common_changed == 'true' || inputs.run_all }} | |
uses: ./.github/workflows/ci_ios.yml | |
android: | |
needs: filter | |
if: ${{ needs.filter.outputs.android_changed == 'true' || needs.filter.outputs.common_changed == 'true' || inputs.run_all }} | |
uses: ./.github/workflows/ci_android.yml |