From 0e54e73bb5aa1a65e093ea739f068bb6b24a5128 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 3 Mar 2021 21:15:03 +0100 Subject: [PATCH 01/17] Add .circleci/config.yml --- .circleci/config.yml | 90 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..1d65b2a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,90 @@ +# Author @mvxt +version: 2.1 + +# Simple YAML anchors +aliases: + - &project_dir "~/project" + +commands: + dependencies: + description: "Download dependencies and setup global packages" + parameters: + shell: + type: string + default: "/bin/bash --login -eo pipefail" + pub-cache: + type: string + default: "~/.pub-cache" + steps: + - checkout + - restore_cache: + keys: + - v1.4-dependencies-{{ arch }}-{{ checksum "pubspec.lock" }} + - v1.4-dependencies-{{ arch }}- + - run: + name: Download deps + shell: << parameters.shell >> + command: pub get + - run: + name: Get junitreporter + shell: << parameters.shell >> + command: pub global activate junitreport + - save_cache: + key: v1.4-dependencies-{{ arch }}-{{ checksum "pubspec.lock" }} + paths: + - .dart_tool + - << parameters.pub-cache >> + +###### ################ +# Workflow definition +###### ################ +workflows: + version: 2.1 + test-and-build: + jobs: + - test + - build-linux: + requires: + - test +################## +# Job Definitions +################## +jobs: + test: + docker: + - image: google/dart:2.9.1 + auth: + username: $DOCKER_USERNAME + password: $DOCKER_PASSWORD # context / project UI env-var reference + steps: + - dependencies: + shell: "/bin/bash -eo pipefail" + - run: + name: Make folder for test results + command: mkdir -p test-results/dart-tests + - run: + name: Run tests + command: pub run test --reporter json | tojunit --output test-results/dart-tests/circleci_dart_demo_test-report.xml + - store_test_results: + path: test-results + + build-linux: + machine: true + steps: + - run: + name: Install Dart SDK + shell: /bin/bash --login -eo pipefail + command: | + # Setup repo & signing key + sudo apt update + sudo apt install apt-transport-https + sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' + sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list' + + # Update again and install + sudo apt update + sudo apt install dart + + # Set PATH in profile for downstream commands + echo "export PATH=$PATH:/usr/lib/dart/bin" >> $BASH_ENV + - dependencies \ No newline at end of file From 539b64b8baaba5c8bb75f6f1bf6273d3e008c3dc Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 5 Mar 2021 23:19:29 +0100 Subject: [PATCH 02/17] Try new config --- .circleci/config.yml | 126 ++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 74 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d65b2a..b89fd07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,90 +1,68 @@ -# Author @mvxt version: 2.1 -# Simple YAML anchors -aliases: - - &project_dir "~/project" +jobs: + # build: + # docker: + # - image: cirrusci/flutter:stable + # steps: + # - checkout + # - run: flutter doctor + # - run: flutter test + # - run: flutter -v build apk -commands: - dependencies: - description: "Download dependencies and setup global packages" - parameters: - shell: - type: string - default: "/bin/bash --login -eo pipefail" - pub-cache: - type: string - default: "~/.pub-cache" + lint: + description: "Run static analysis for Flutter" + docker: + - image: cirrusci/flutter:v1.10.7 + working_directory: ~/repo steps: - checkout - restore_cache: keys: - - v1.4-dependencies-{{ arch }}-{{ checksum "pubspec.lock" }} - - v1.4-dependencies-{{ arch }}- + - dart-dependencies-{{ checksum "pubspec.lock" }} + - dart-dependencies- - run: - name: Download deps - shell: << parameters.shell >> - command: pub get + name: Install Dependencies + command: flutter pub get - run: - name: Get junitreporter - shell: << parameters.shell >> - command: pub global activate junitreport + name: Build + command: flutter packages pub run build_runner build - save_cache: - key: v1.4-dependencies-{{ arch }}-{{ checksum "pubspec.lock" }} paths: - .dart_tool - - << parameters.pub-cache >> - -###### ################ -# Workflow definition -###### ################ -workflows: - version: 2.1 - test-and-build: - jobs: - - test - - build-linux: - requires: - - test -################## -# Job Definitions -################## -jobs: - test: - docker: - - image: google/dart:2.9.1 - auth: - username: $DOCKER_USERNAME - password: $DOCKER_PASSWORD # context / project UI env-var reference - steps: - - dependencies: - shell: "/bin/bash -eo pipefail" + key: dart-dependencies-{{ checksum "pubspec.lock" }} - run: - name: Make folder for test results - command: mkdir -p test-results/dart-tests + name: Analyze code + command: flutter analyze lib + + test: + description: "Run tests for Flutter" + docker: + - image: cirrusci/flutter:v1.10.7 + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - dart-dependencies-{{ checksum "pubspec.lock" }} + - dart-dependencies- + + - run: + name: Install Dependencies + command: flutter pub get + + - run: + name: Build + command: flutter packages pub run build_runner build + + - save_cache: + paths: + - .dart_tool + key: dart-dependencies-{{ checksum "pubspec.lock" }} + - run: name: Run tests - command: pub run test --reporter json | tojunit --output test-results/dart-tests/circleci_dart_demo_test-report.xml + command: flutter test | tojunit --output test-results + - store_test_results: - path: test-results - - build-linux: - machine: true - steps: - - run: - name: Install Dart SDK - shell: /bin/bash --login -eo pipefail - command: | - # Setup repo & signing key - sudo apt update - sudo apt install apt-transport-https - sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' - sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list' - - # Update again and install - sudo apt update - sudo apt install dart - - # Set PATH in profile for downstream commands - echo "export PATH=$PATH:/usr/lib/dart/bin" >> $BASH_ENV - - dependencies \ No newline at end of file + path: test-results \ No newline at end of file From 3820517afdbee377fd527919085ac51b8200f40f Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 5 Mar 2021 23:20:50 +0100 Subject: [PATCH 03/17] Add workflow definition --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b89fd07..45c0ce8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,4 +65,10 @@ jobs: command: flutter test | tojunit --output test-results - store_test_results: - path: test-results \ No newline at end of file + path: test-results + +workflows: + build_and_test: + jobs: + - lint + - test \ No newline at end of file From 6eab955075b1bb6257daebd70847b721b37313d7 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 5 Mar 2021 23:31:36 +0100 Subject: [PATCH 04/17] Add build job --- .circleci/config.yml | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 45c0ce8..22ea7c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,64 +1,63 @@ version: 2.1 jobs: - # build: - # docker: - # - image: cirrusci/flutter:stable - # steps: - # - checkout - # - run: flutter doctor - # - run: flutter test - # - run: flutter -v build apk - - lint: - description: "Run static analysis for Flutter" + build: + description: "Build the application into an Android APK executable" docker: - - image: cirrusci/flutter:v1.10.7 - working_directory: ~/repo + - image: cirrusci/flutter:stable + working_directory: ~/project steps: - checkout - - restore_cache: - keys: - - dart-dependencies-{{ checksum "pubspec.lock" }} - - dart-dependencies- + - run: + name: Print + command: flutter doctor + - run: name: Install Dependencies command: flutter pub get + - run: name: Build - command: flutter packages pub run build_runner build - - save_cache: - paths: - - .dart_tool - key: dart-dependencies-{{ checksum "pubspec.lock" }} + command: flutter -v build apk + + # - save_cache: + # paths: + # - .dart_tool + # key: dart-dependencies-{{ checksum "pubspec.lock" }} + + lint: + description: "Run static analysis for the code" + requires: build + docker: + - image: cirrusci/flutter:v1.10.7 + working_directory: ~/project + steps: + - checkout + # - restore_cache: + # keys: + # - dart-dependencies-{{ checksum "pubspec.lock" }} + # - dart-dependencies- - run: name: Analyze code command: flutter analyze lib test: - description: "Run tests for Flutter" + description: "Run all unittests" + requires: build docker: - image: cirrusci/flutter:v1.10.7 - working_directory: ~/repo + working_directory: ~/project steps: - checkout - - restore_cache: - keys: - - dart-dependencies-{{ checksum "pubspec.lock" }} - - dart-dependencies- + # - restore_cache: + # keys: + # - dart-dependencies-{{ checksum "pubspec.lock" }} + # - dart-dependencies- - - run: - name: Install Dependencies - command: flutter pub get - - - run: - name: Build - command: flutter packages pub run build_runner build - - - save_cache: - paths: - - .dart_tool - key: dart-dependencies-{{ checksum "pubspec.lock" }} + # - save_cache: + # paths: + # - .dart_tool + # key: dart-dependencies-{{ checksum "pubspec.lock" }} - run: name: Run tests @@ -70,5 +69,6 @@ jobs: workflows: build_and_test: jobs: + - build - lint - test \ No newline at end of file From 8432306edbe0f0a46a492ff412a21be1b2f236d2 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 5 Mar 2021 23:40:05 +0100 Subject: [PATCH 05/17] Move 'requires' keyword to workflows --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 22ea7c1..49efd43 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,12 +27,11 @@ jobs: lint: description: "Run static analysis for the code" - requires: build docker: - - image: cirrusci/flutter:v1.10.7 + - image: cirrusci/flutter:stable working_directory: ~/project steps: - - checkout + # - checkout # - restore_cache: # keys: # - dart-dependencies-{{ checksum "pubspec.lock" }} @@ -43,12 +42,11 @@ jobs: test: description: "Run all unittests" - requires: build docker: - - image: cirrusci/flutter:v1.10.7 + - image: cirrusci/flutter:stable working_directory: ~/project steps: - - checkout + # - checkout # - restore_cache: # keys: # - dart-dependencies-{{ checksum "pubspec.lock" }} @@ -70,5 +68,7 @@ workflows: build_and_test: jobs: - build - - lint - - test \ No newline at end of file + - lint: + requires: build + - test: + requires: build \ No newline at end of file From 8524c2ee56a6ec8b9efb9d9e621559f9dadea98e Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 5 Mar 2021 23:41:43 +0100 Subject: [PATCH 06/17] turn requirements into lists --- .circleci/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 49efd43..6eea08e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,6 +69,8 @@ workflows: jobs: - build - lint: - requires: build + requires: + - build - test: - requires: build \ No newline at end of file + requires: + - build \ No newline at end of file From 3e3871fe7e92eeb7a2474c7b537710a51f6d0c1f Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 00:01:51 +0100 Subject: [PATCH 07/17] Save dependencies to cache --- .circleci/config.yml | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6eea08e..b811e5f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,10 +20,10 @@ jobs: name: Build command: flutter -v build apk - # - save_cache: - # paths: - # - .dart_tool - # key: dart-dependencies-{{ checksum "pubspec.lock" }} + - save_cache: + paths: + - .dart_tool + key: dart-dependencies-{{ checksum "pubspec.lock" }} lint: description: "Run static analysis for the code" @@ -31,11 +31,13 @@ jobs: - image: cirrusci/flutter:stable working_directory: ~/project steps: - # - checkout - # - restore_cache: - # keys: - # - dart-dependencies-{{ checksum "pubspec.lock" }} - # - dart-dependencies- + - checkout + + - restore_cache: + keys: + - dart-dependencies-{{ checksum "pubspec.lock" }} + - dart-dependencies- + - run: name: Analyze code command: flutter analyze lib @@ -46,16 +48,11 @@ jobs: - image: cirrusci/flutter:stable working_directory: ~/project steps: - # - checkout - # - restore_cache: - # keys: - # - dart-dependencies-{{ checksum "pubspec.lock" }} - # - dart-dependencies- - - # - save_cache: - # paths: - # - .dart_tool - # key: dart-dependencies-{{ checksum "pubspec.lock" }} + - checkout + - restore_cache: + keys: + - dart-dependencies-{{ checksum "pubspec.lock" }} + - dart-dependencies- - run: name: Run tests From acd2246c3861dcf89b7fb8fa8974c705376cc8c1 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 00:06:02 +0100 Subject: [PATCH 08/17] Add pubspec.lock --- .gitignore | 4 +- pubspec.lock | 292 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 293 insertions(+), 3 deletions(-) create mode 100644 pubspec.lock diff --git a/.gitignore b/.gitignore index ec2d65d..d16b8eb 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,4 @@ lib/generated_plugin_registrant.dart # Exceptions to above rules. -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages - -pubspec.lock \ No newline at end of file +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..0882c92 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,292 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0" + bloc: + dependency: transitive + description: + name: bloc + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.2" + division: + dependency: "direct main" + description: + name: division + url: "https://pub.dartlang.org" + source: hosted + version: "0.8.8" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_bloc: + dependency: "direct main" + description: + name: flutter_bloc + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+4" + html_unescape: + dependency: transitive + description: + name: html_unescape + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + provider: + dependency: transitive + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + unofficial_jisho_api: + dependency: "direct main" + description: + name: unofficial_jisho_api + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "5.7.10" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+4" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+9" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.9" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5+3" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+3" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" +sdks: + dart: ">=2.12.0-0.0 <3.0.0" + flutter: ">=1.22.0" From df4d02dab2c3101abfa7dac0431b5eac2299ea3a Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 00:16:59 +0100 Subject: [PATCH 09/17] Add step to install test report converter --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b811e5f..aa33c95 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,9 +54,13 @@ jobs: - dart-dependencies-{{ checksum "pubspec.lock" }} - dart-dependencies- + - run: + name: Install test report converter tool + command: pub global activate junitreport + - run: name: Run tests - command: flutter test | tojunit --output test-results + command: flutter test | .pub-cache/bin/tojunit --output test-results - store_test_results: path: test-results From 44ecad4f285789662eec95a70471351ebc10a2cd Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 00:22:26 +0100 Subject: [PATCH 10/17] Add no-fatal-infos to analyze step --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aa33c95..a2fa212 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,7 @@ jobs: - run: name: Analyze code - command: flutter analyze lib + command: flutter analyze --no-fatal-infos test: description: "Run all unittests" From 8e040d6778ada79b49dbe30ee66bf5d365db3ca4 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 00:24:23 +0100 Subject: [PATCH 11/17] Run tojunit from homefolder --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a2fa212..9539e7c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,7 +60,7 @@ jobs: - run: name: Run tests - command: flutter test | .pub-cache/bin/tojunit --output test-results + command: flutter test | ~/.pub-cache/bin/tojunit --output test-results - store_test_results: path: test-results From 39dc0fdc7234c8d2fa75d26fc5daa97ec8e389dc Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 00:33:45 +0100 Subject: [PATCH 12/17] Add needed flag to run unittests --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9539e7c..983b1ec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,10 +60,10 @@ jobs: - run: name: Run tests - command: flutter test | ~/.pub-cache/bin/tojunit --output test-results + command: flutter test --machine | ~/.pub-cache/bin/tojunit --output test-results.xml - store_test_results: - path: test-results + path: test-results.xml workflows: build_and_test: From 23056c8a9566912576c2c808768a2a57a452e1cb Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 00:42:50 +0100 Subject: [PATCH 13/17] Add command to ignore exit code 1 on tests --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 983b1ec..ad2feab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,7 +60,7 @@ jobs: - run: name: Run tests - command: flutter test --machine | ~/.pub-cache/bin/tojunit --output test-results.xml + command: flutter test --machine | ~/.pub-cache/bin/tojunit --output test-results.xml || true - store_test_results: path: test-results.xml From 72ca8bce59e7deaa9adc264b377a5d66cbf622d6 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 00:48:57 +0100 Subject: [PATCH 14/17] Fix test result directory structure --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ad2feab..b96fe6d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,10 +60,10 @@ jobs: - run: name: Run tests - command: flutter test --machine | ~/.pub-cache/bin/tojunit --output test-results.xml || true + command: flutter test --machine | ~/.pub-cache/bin/tojunit --output test-results/flutter/results.xml || true - store_test_results: - path: test-results.xml + path: test-results workflows: build_and_test: From 33b7ad00581e044bb713b2d1feba72072697dd3c Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 00:57:31 +0100 Subject: [PATCH 15/17] Store analysis data as an artifact --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b96fe6d..2e10b1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,10 @@ jobs: - run: name: Analyze code - command: flutter analyze --no-fatal-infos + command: flutter analyze --no-fatal-infos > lint_analysis_data/results.txt + + - store_artifacts: + path: ~/project/lint_analysis_data test: description: "Run all unittests" From 3fbc9f0693a91d68e5b75d6d64e57158172d133e Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 01:02:39 +0100 Subject: [PATCH 16/17] Add folder generation steps --- .circleci/config.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2e10b1e..35ba69b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,6 +38,10 @@ jobs: - dart-dependencies-{{ checksum "pubspec.lock" }} - dart-dependencies- + - run: + name: Make folder for analysis results + command: mkdir lint_analysis_data + - run: name: Analyze code command: flutter analyze --no-fatal-infos > lint_analysis_data/results.txt @@ -61,12 +65,16 @@ jobs: name: Install test report converter tool command: pub global activate junitreport + - run: + name: Make folder for test results + command: mkdir -p test_results/flutter + - run: name: Run tests - command: flutter test --machine | ~/.pub-cache/bin/tojunit --output test-results/flutter/results.xml || true + command: flutter test --machine | ~/.pub-cache/bin/tojunit --output test_results/flutter/results.xml || true - store_test_results: - path: test-results + path: test_results workflows: build_and_test: From 1f0b717e7e455af253513aed2ebd16f6afb0b96e Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 6 Mar 2021 01:56:11 +0100 Subject: [PATCH 17/17] Add circleci badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7827e81..eee81f7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![CircleCI Status](https://circleci.com/gh/h7x4ABk3g/Jisho-Study-Tool.svg?style=shield)]() + # Jisho Study tool A japanese dictionary with features for making studying the language easier.