From c20d7fe6dfdb24112930cb44c0e4f794b012a5f7 Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Sun, 26 Feb 2023 17:38:14 +0100 Subject: [PATCH 1/6] add pipeline --- gitlab-ci.yaml | 15 +++++++++++++++ lib/widgets/mood_form.dart | 3 +-- lib/widgets/sleep_form.dart | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 gitlab-ci.yaml diff --git a/gitlab-ci.yaml b/gitlab-ci.yaml new file mode 100644 index 0000000..6ebf925 --- /dev/null +++ b/gitlab-ci.yaml @@ -0,0 +1,15 @@ +image: matspfeiffer/flutter:latest + +stages: + - analyze + +before_script: + — flutter pub get + — flutter clean + +analyze: + stage: analyze + script: + - flutter analyze --no-fatal-infos --no-fatal-warnings + only: + — merge_requests \ No newline at end of file diff --git a/lib/widgets/mood_form.dart b/lib/widgets/mood_form.dart index 20031df..f6fd0e0 100644 --- a/lib/widgets/mood_form.dart +++ b/lib/widgets/mood_form.dart @@ -22,8 +22,7 @@ class _MoodFormState extends State { void submitForm() { if (_moodFormKey.currentState!.validate()) { _moodFormKey.currentState?.save(); //call every onSave Method - Mood mood = - Mood(slider.getSliderValue().toInt(), _textInput, DateTime.now()); + Mood mood = Mood(slider.sliderValue.toInt(), _textInput, DateTime.now()); DatabaseService.instance.addMood(mood); _moodFormKey.currentState?.reset(); } diff --git a/lib/widgets/sleep_form.dart b/lib/widgets/sleep_form.dart index 732a27a..eb86e89 100644 --- a/lib/widgets/sleep_form.dart +++ b/lib/widgets/sleep_form.dart @@ -29,7 +29,7 @@ class _SleepFormState extends State { if (_sleepFormKey.currentState!.validate()) { _sleepFormKey.currentState?.save(); //call every onSave Method Sleep sleep = Sleep( - slider.getSliderValue().toInt(), + slider.sliderValue.toInt(), _textInput, DateTime.now(), sleepTimePicker.getCurrentTime, From b27f892a367be612dac16768c86af3cf95e945b2 Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Sun, 26 Feb 2023 17:41:17 +0100 Subject: [PATCH 2/6] rename pipeline file --- gitlab-ci.yaml => .gitlab-ci.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gitlab-ci.yaml => .gitlab-ci.yaml (100%) diff --git a/gitlab-ci.yaml b/.gitlab-ci.yaml similarity index 100% rename from gitlab-ci.yaml rename to .gitlab-ci.yaml From ffddfe267357e3f700af118fe1acf69e82be7392 Mon Sep 17 00:00:00 2001 From: Julian Gegner Date: Sun, 26 Feb 2023 16:42:44 +0000 Subject: [PATCH 3/6] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..64b372d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,49 @@ +# This file is a template, and might need editing before it works on your project. +# This is a sample GitLab CI/CD configuration file that should run without any modifications. +# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts, +# it uses echo commands to simulate the pipeline execution. +# +# A pipeline is composed of independent jobs that run scripts, grouped into stages. +# Stages run in sequential order, but jobs within stages run in parallel. +# +# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages +# +# You can copy and paste this template into a new `.gitlab-ci.yml` file. +# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword. +# +# To contribute improvements to CI/CD templates, please follow the Development guide at: +# https://docs.gitlab.com/ee/development/cicd/templates.html +# This specific template is located at: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml + +stages: # List of stages for jobs, and their order of execution + - build + - test + - deploy + +build-job: # This job runs in the build stage, which runs first. + stage: build + script: + - echo "Compiling the code..." + - echo "Compile complete." + +unit-test-job: # This job runs in the test stage. + stage: test # It only starts when the job in the build stage completes successfully. + script: + - echo "Running unit tests... This will take about 60 seconds." + - sleep 60 + - echo "Code coverage is 90%" + +lint-test-job: # This job also runs in the test stage. + stage: test # It can run at the same time as unit-test-job (in parallel). + script: + - echo "Linting code... This will take about 10 seconds." + - sleep 10 + - echo "No lint issues found." + +deploy-job: # This job runs in the deploy stage. + stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + environment: production + script: + - echo "Deploying application..." + - echo "Application successfully deployed." From fcab615d9f57ab84edf285ca026e6cdc20f9db90 Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Sun, 26 Feb 2023 17:43:57 +0100 Subject: [PATCH 4/6] rename again --- .gitlab-ci.yaml => .gitlab-ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .gitlab-ci.yaml => .gitlab-ci.yml (100%) diff --git a/.gitlab-ci.yaml b/.gitlab-ci.yml similarity index 100% rename from .gitlab-ci.yaml rename to .gitlab-ci.yml From ab065c3116f774531845d9a827202fa9c470d1bc Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Sun, 26 Feb 2023 17:46:40 +0100 Subject: [PATCH 5/6] validated syntax --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dcd0a50..38b9c74 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,12 +4,12 @@ stages: - analyze before_script: - — flutter pub get - — flutter clean + - flutter pub get + - flutter clean analyze: stage: analyze script: - flutter analyze --no-fatal-infos --no-fatal-warnings - only: - — merge_requests + only: + - merge_requests From e110cfb684f9842c593e69725aec4466780dee24 Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Sun, 26 Feb 2023 18:03:00 +0100 Subject: [PATCH 6/6] use different image --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 38b9c74..562ecfe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: matspfeiffer/flutter:latest +image: cirrusci/flutter:latest stages: - analyze @@ -10,6 +10,6 @@ before_script: analyze: stage: analyze script: - - flutter analyze --no-fatal-infos --no-fatal-warnings + - flutter analyze only: - merge_requests