Commit 96b46cac authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'add-flutter-cicd-template' into 'master'

Add flutter cicd template

See merge request gitlab-org/gitlab!46968
parents 445de9c5 f0ac34b4
---
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