Skip to content

Commit

Permalink
Set up example workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mosuem committed Nov 15, 2024
1 parent 5099841 commit e12da94
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/repos.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/Skyost/OpenAuthenticator
https://github.com/KarelGT/DwarfDoc
https://github.com/umasagashi/umacapture
61 changes: 61 additions & 0 deletions .github/workflows/repo_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Ecosystem test

on:
workflow_dispatch:
inputs:
repos_file:
description: 'Path to the file containing the list of repository names'
required: true
default: '.github/repos.txt'
package_name:
description: 'Name of the package to update'
default: 'intl' ##DO-NOT-SUBMIT
# required: true
new_version:
description: 'New version of the package'
default: 0.20.0
# required: true
level:
description: 'What to check, resolve, analyze, or test'

jobs:
update_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
repo: ${{ fromJson(github.event.inputs.repos) }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: ${{ matrix.repo }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Read repository list
id: repos
run: |
echo "repos=$(cat ${{ github.event.inputs.repos_file }})" >> $GITHUB_OUTPUT
- name: Update package version in pubspec.yaml
run: |
sed -i 's/\(${package_name}:\s*\)\(.*\)/\1${{ github.event.inputs.new_version }}/' pubspec.yaml
- name: Get Flutter SDK Version
run: |
echo "flutter_version=$(grep 'sdk:\s*flutter' pubspec.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: ${{ steps.get-flutter-version.outputs.flutter_version }}

- name: Install dependencies
run: flutter pub get

- name: Run tests
if: ${{ github.event.inputs.level == 'analyze' || github.event.inputs.level == 'test' }}
run: flutter analyze

- name: Run tests
if: ${{ github.event.inputs.level == 'test' }}
run: flutter test

0 comments on commit e12da94

Please sign in to comment.