From 09ace76b82cf9532dc77c5c05d99d129ffdce962 Mon Sep 17 00:00:00 2001 From: Alexandre Roux Date: Mon, 4 Oct 2021 21:27:37 +0200 Subject: [PATCH] build: setup dart simple ci using github actions (#114) --- .github/workflows/ci_dart.yml | 32 ++++++++++++++++++++++++++ packages/repo_support/.gitignore | 23 ++++++++++++++++++ packages/repo_support/README.md | 8 +++++++ packages/repo_support/pubspec.yaml | 11 +++++++++ packages/repo_support/tool/run_ci.dart | 14 +++++++++++ 5 files changed, 88 insertions(+) create mode 100644 .github/workflows/ci_dart.yml create mode 100644 packages/repo_support/.gitignore create mode 100644 packages/repo_support/README.md create mode 100644 packages/repo_support/pubspec.yaml create mode 100644 packages/repo_support/tool/run_ci.dart diff --git a/.github/workflows/ci_dart.yml b/.github/workflows/ci_dart.yml new file mode 100644 index 0000000000..390e8f2d54 --- /dev/null +++ b/.github/workflows/ci_dart.yml @@ -0,0 +1,32 @@ +name: Run CI +on: + push: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' # every sunday at midnight + +jobs: + test: + name: Test on ${{ matrix.os }} / ${{ matrix.flutter }} + runs-on: ${{ matrix.os }} + defaults: + run: + working-directory: packages/repo_support + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + flutter: [stable, beta, dev] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: '12.x' + - uses: subosito/flutter-action@v1 + with: + channel: ${{ matrix.flutter }} + - run: flutter --version + - run: flutter upgrade + - run: dart --version + - run: dart pub get + - run: dart run tool/run_ci.dart \ No newline at end of file diff --git a/packages/repo_support/.gitignore b/packages/repo_support/.gitignore new file mode 100644 index 0000000000..cf380e8ebd --- /dev/null +++ b/packages/repo_support/.gitignore @@ -0,0 +1,23 @@ +# See https://www.dartlang.org/guides/libraries/private-files + +# Files and directories created by pub +.dart_tool/ +.packages +.pub/ +build/ +# If you're building an application, you may want to check-in your pubspec.lock +pubspec.lock + +# Directory created by dartdoc +# If you don't generate documentation locally you can remove this line. +doc/api/ + +# Intellij +*.idea/ +*.iml + +# VS code +.vscode + +# Local +.local/ \ No newline at end of file diff --git a/packages/repo_support/README.md b/packages/repo_support/README.md new file mode 100644 index 0000000000..fb7e35f171 --- /dev/null +++ b/packages/repo_support/README.md @@ -0,0 +1,8 @@ +# repo_support + +App flutter utils repo support + +``` +dart run tool/run_ci.dart + +``` \ No newline at end of file diff --git a/packages/repo_support/pubspec.yaml b/packages/repo_support/pubspec.yaml new file mode 100644 index 0000000000..c404313016 --- /dev/null +++ b/packages/repo_support/pubspec.yaml @@ -0,0 +1,11 @@ +name: simplex_repo_support +description: SimpleX build tools +version: 0.2.0 +publish_to: none + +environment: + sdk: '>=2.12.0 <3.0.0' + +dev_dependencies: + dev_test: + diff --git a/packages/repo_support/tool/run_ci.dart b/packages/repo_support/tool/run_ci.dart new file mode 100644 index 0000000000..4ed6768dd7 --- /dev/null +++ b/packages/repo_support/tool/run_ci.dart @@ -0,0 +1,14 @@ +// ignore_for_file: prefer_double_quotes + +import 'package:dev_test/package.dart'; +import 'package:path/path.dart'; + +Future main() async { + for (var dir in [ + 'simplex_app', + 'simplexmq', + 'repo_support', + ]) { + await packageRunCi(join('..', dir)); + } +}