Skip to content

Commit

Permalink
chore: add special testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
martynov-alex committed Mar 4, 2024
1 parent 9fecdda commit 0a2c348
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:
inputs:
flutter-version:
required: true
required: false
type: string

jobs:
Expand Down
File renamed without changes.
14 changes: 1 addition & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,8 @@ jobs:

testing:
needs: [analysis, get_fvm_version]
uses: surfstudio/flutter-ci-workflows/.github/workflows/testing.yml@main
uses: ./.github/workflows/testing.yml
with:
flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

build_android_example:
needs: [analysis, get_fvm_version]
uses: surfstudio/flutter-ci-workflows/.github/workflows/build_android_example.yml@main
with:
flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }}

build_ios_example:
needs: [analysis, get_fvm_version]
uses: surfstudio/flutter-ci-workflows/.github/workflows/build_ios_example.yml@main
with:
flutter-version: ${{ needs.get_fvm_version.outputs.flutter_version }}
45 changes: 45 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Testing"

on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: true
inputs:
flutter-version:
required: false
type: string

jobs:
testing:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Flutter with exact version
if: ${{ inputs.flutter-version != ''}}
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ inputs.flutter-version }}

- name: Install Flutter from Stable branch
if: ${{ inputs.flutter-version == ''}}
uses: subosito/flutter-action@v2
with:
channel: "stable"

- name: Install dependencies
run: flutter pub get

- name: Generate files
run: dart run build_runner build --delete-conflicting-outputs

- name: Run tests
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
if: success()
run: |
flutter test --coverage
bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info

0 comments on commit 0a2c348

Please sign in to comment.