CI #2734
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
name: CI | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: "0 10 * * *" | |
permissions: | |
contents: write | |
jobs: | |
flutter: | |
name: ${{ matrix.package_name_and_runs_on.package_name }} on Flutter ${{ matrix.channel_version.channel }} | |
runs-on: ${{ matrix.package_name_and_runs_on.runs_on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
package_name_and_runs_on: | |
- {package_name: convenient_test, runs_on: ubuntu-latest} | |
- {package_name: convenient_test/example, runs_on: ubuntu-latest} | |
- {package_name: convenient_test_common, runs_on: ubuntu-latest} | |
- {package_name: convenient_test_common_dart, runs_on: ubuntu-latest} | |
- {package_name: convenient_test_dev, runs_on: ubuntu-latest} | |
# NOTE run `convenient_test_manager` on macos for its goldens | |
- {package_name: convenient_test_manager, runs_on: macos-latest} | |
- {package_name: convenient_test_manager_dart, runs_on: ubuntu-latest} | |
channel_version: | |
- { channel: stable } | |
# - { channel: beta } | |
# see https://github.com/fzyzcjy/flutter_convenient_test/pull/319#issuecomment-1445048397 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: ${{ matrix.channel_version.channel }} | |
# flutter-version: ${{ matrix.channel_version.version }} | |
- name: Install dependencies | |
run: flutter pub get | |
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }} | |
- name: Analyze | |
run: flutter analyze | |
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }} | |
- name: Run tests | |
run: flutter test | |
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }} | |
- name: Check format | |
run: dart format --set-exit-if-changed . | |
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }} | |
build_manager_macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- name: Enable Macos | |
run: flutter config --enable-macos-desktop | |
- name: Install dependencies | |
run: flutter pub get | |
working-directory: packages/convenient_test_manager | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.1.0" | |
bundler-cache: true | |
- name: setup-cocoapods | |
uses: maxim-lobanov/setup-cocoapods@v1 | |
with: | |
version: latest | |
- name: flutter build | |
run: flutter build macos | |
working-directory: packages/convenient_test_manager/macos | |
- name: build_mac_app | |
run: bundle install && bundle exec fastlane run build_mac_app export_method:mac-application scheme:Runner output_directory:./build | |
working-directory: packages/convenient_test_manager/macos | |
- name: Tar outputs | |
run: tar cvf manager_gui_macos.zip convenient_test_manager.app | |
working-directory: packages/convenient_test_manager/macos/build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: manager_gui_macos.zip | |
path: packages/convenient_test_manager/macos/build/manager_gui_macos.zip | |
- name: Add to release if tagged | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: packages/convenient_test_manager/macos/build/manager_gui_macos.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build_manager_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- name: Enable Linux | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev libvlc-dev vlc | |
flutter config --enable-linux-desktop | |
working-directory: packages/convenient_test_manager | |
- name: Install dependencies | |
run: flutter pub get | |
working-directory: packages/convenient_test_manager | |
- name: flutter build | |
run: flutter build linux | |
working-directory: packages/convenient_test_manager | |
- name: Tar outputs | |
run: tar -czvf manager_gui_linux.tar.gz bundle | |
working-directory: packages/convenient_test_manager/build/linux/x64/release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: manager_gui_linux.tar.gz | |
path: packages/convenient_test_manager/build/linux/x64/release/manager_gui_linux.tar.gz | |
- name: Add to release if tagged | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: packages/convenient_test_manager/build/linux/x64/release/manager_gui_linux.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build_manager_dart_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- name: Install dependencies | |
run: flutter pub get | |
working-directory: packages/convenient_test_manager_dart | |
- name: Build | |
run: dart compile exe bin/convenient_test_manager_dart.dart -o manager_cli_linux | |
working-directory: packages/convenient_test_manager_dart | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: manager_cli_linux | |
path: packages/convenient_test_manager_dart/manager_cli_linux | |
- name: Add to release if tagged | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: packages/convenient_test_manager_dart/manager_cli_linux | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build_manager_windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- name: Enable windows build | |
run: flutter config --enable-windows-desktop | |
working-directory: packages/convenient_test_manager | |
- name: Install project dependencies | |
run: flutter pub get | |
working-directory: packages/convenient_test_manager | |
- name: Build artifacts | |
run: flutter build windows --release | |
working-directory: packages/convenient_test_manager | |
- name: Archive Release | |
uses: thedoctor0/zip-release@master | |
with: | |
type: zip | |
filename: manager_gui_windows.zip | |
directory: packages/convenient_test_manager/build/windows/x64/runner/Release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: manager_gui_windows.zip | |
path: packages/convenient_test_manager/build/windows/x64/runner/Release/manager_gui_windows.zip | |
- name: Add to release if tagged | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: packages/convenient_test_manager/build/windows/x64/runner/Release/manager_gui_windows.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |