Jisho-Study-Tool/.circleci/config.yml

88 lines
2.1 KiB
YAML
Raw Normal View History

2021-03-03 21:15:03 +01:00
version: 2.1
2021-03-05 23:19:29 +01:00
jobs:
2021-03-05 23:31:36 +01:00
build:
description: "Build the application into an Android APK executable"
2021-03-05 23:19:29 +01:00
docker:
2021-03-05 23:31:36 +01:00
- image: cirrusci/flutter:stable
working_directory: ~/project
2021-03-03 21:15:03 +01:00
steps:
- checkout
2021-03-05 23:31:36 +01:00
- run:
name: Print
command: flutter doctor
2021-03-03 21:15:03 +01:00
- run:
2021-03-05 23:19:29 +01:00
name: Install Dependencies
command: flutter pub get
2021-03-05 23:31:36 +01:00
2021-03-03 21:15:03 +01:00
- run:
2021-03-05 23:19:29 +01:00
name: Build
2021-03-05 23:31:36 +01:00
command: flutter -v build apk
2021-03-06 00:01:51 +01:00
- save_cache:
paths:
- .dart_tool
key: dart-dependencies-{{ checksum "pubspec.lock" }}
2021-03-05 23:31:36 +01:00
lint:
description: "Run static analysis for the code"
docker:
2021-03-05 23:40:05 +01:00
- image: cirrusci/flutter:stable
2021-03-05 23:31:36 +01:00
working_directory: ~/project
steps:
2021-03-06 00:01:51 +01:00
- checkout
- restore_cache:
keys:
- dart-dependencies-{{ checksum "pubspec.lock" }}
- dart-dependencies-
2021-03-06 01:02:39 +01:00
- run:
name: Make folder for analysis results
command: mkdir lint_analysis_data
2021-03-05 23:19:29 +01:00
- run:
name: Analyze code
2021-03-06 00:57:31 +01:00
command: flutter analyze --no-fatal-infos > lint_analysis_data/results.txt
- store_artifacts:
path: ~/project/lint_analysis_data
2021-03-03 21:15:03 +01:00
test:
2021-03-05 23:31:36 +01:00
description: "Run all unittests"
2021-03-03 21:15:03 +01:00
docker:
2021-03-05 23:40:05 +01:00
- image: cirrusci/flutter:stable
2021-03-05 23:31:36 +01:00
working_directory: ~/project
2021-03-03 21:15:03 +01:00
steps:
2021-03-06 00:01:51 +01:00
- checkout
- restore_cache:
keys:
- dart-dependencies-{{ checksum "pubspec.lock" }}
- dart-dependencies-
2021-03-03 21:15:03 +01:00
- run:
name: Install test report converter tool
command: pub global activate junitreport
2021-03-06 01:02:39 +01:00
- run:
name: Make folder for test results
command: mkdir -p test_results/flutter
2021-03-05 23:19:29 +01:00
- run:
name: Run tests
2021-03-06 01:02:39 +01:00
command: flutter test --machine | ~/.pub-cache/bin/tojunit --output test_results/flutter/results.xml || true
2021-03-05 23:19:29 +01:00
- store_test_results:
2021-03-06 01:02:39 +01:00
path: test_results
2021-03-05 23:20:50 +01:00
workflows:
build_and_test:
jobs:
2021-03-05 23:31:36 +01:00
- build
2021-03-05 23:40:05 +01:00
- lint:
2021-03-05 23:41:43 +01:00
requires:
- build
2021-03-05 23:40:05 +01:00
- test:
2021-03-05 23:41:43 +01:00
requires:
- build