CI #2321
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 * * *" | |
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@v3 | |
- 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 --line-length 120 . | |
working-directory: packages/${{ matrix.package_name_and_runs_on.package_name }} | |
# TODO fix it (seems GitHub Actions upgraded, making Fastlane confused) | |
# build_manager_macos: | |
# runs-on: macos-11 | |
# | |
# steps: | |
# - uses: actions/checkout@v3 | |
# | |
# - 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: "2.7.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: cd packages/convenient_test_manager/macos/build && tar cvf convenient_test_manager.app.tar convenient_test_manager.app | |
# | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: manager_macos | |
# path: packages/convenient_test_manager/macos/build/convenient_test_manager.app.tar | |
build_manager_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 convenient_test_manager.tar.gz -C packages/convenient_test_manager/build/linux/x64/release/ bundle | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: manager_linux | |
path: convenient_test_manager.tar.gz | |
build_manager_dart_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 convenient_test_manager_dart | |
working-directory: packages/convenient_test_manager_dart | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: manager_dart_linux | |
path: packages/convenient_test_manager_dart/convenient_test_manager_dart |