Commit f0ac34b4 authored by Silvester Wainaina's avatar Silvester Wainaina Committed by Shinya Maeda

Add flutter CI/CD template

Add Changelog entry

Rename job names

Include the default stages

Update template file

Added test files

Added missing to test

Update jobs in test file

Added code coverage report

Add export path

Update the change log file

Revert "Update jobs in test file"

This reverts commit 7298ce4f55df9755bf4909a49c8e8f4f0378b401.
parent d033d6c7
---
title: Add flutter CI/CD template
merge_request: 46968
author:
type: added
code_quality:
stage: test
image: "cirrusci/flutter:1.22.5"
before_script:
- pub global activate dart_code_metrics
- export PATH="$PATH":"$HOME/.pub-cache/bin"
script:
- metrics lib -r codeclimate > gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json
test:
stage: test
image: "cirrusci/flutter:1.22.5"
before_script:
- pub global activate junitreport
- export PATH="$PATH":"$HOME/.pub-cache/bin"
script:
- flutter test --machine --coverage | tojunit -o report.xml
- lcov --summary coverage/lcov.info
- genhtml coverage/lcov.info --output=coverage
coverage: '/lines\.*: \d+\.\d+\%/'
artifacts:
name: coverage
paths:
- $CI_PROJECT_DIR/coverage
reports:
junit: report.xml
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Flutter.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Flutter') }
describe 'the created pipeline' do
let_it_be(:user) { create(:admin) }
let(:pipeline_branch) { 'master' }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push) }
let(:build_names) { pipeline.builds.pluck(:name) }
before do
stub_ci_pipeline_yaml_file(template.content)
allow(Ci::BuildScheduleWorker).to receive(:perform).and_return(true)
end
it 'creates test and code_quality jobs' do
expect(build_names).to include('test', 'code_quality')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment