/
githubmirror
/
fastlane
Обзор
Документация
Войти
/
githubmirror
/
fastlane
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Rakefile
113 строк
3 KB
Connor Tumbleson
[ci] drop CircleCI for GHA (#30108)
04 июл 2026, 22:24
Не верифицирован
04 июл 2026, 22:24
2fc4196
Код
Авторство
О чём код?
require "bundler/gem_tasks" Dir.glob("internal/rakelib/*.rake").each { |r| load r } task(:test_all) do formatter = "--format progress" # On GitHub Actions - automatically write out the rspec logs to be parsed later. formatter += " --format json --out rspec_logs.json" if ENV["GITHUB_ACTIONS"] command = "rspec --pattern spec/**/*_spec.rb,*/spec/**/*_spec.rb #{formatter} #{ENV['RSPEC_ARGS']}" sh(command) end # run, displays and saves the list of tests that do not work standalone task(:test_all_individually) do files = Dir.glob("./**/*_spec.rb") failed = files.select do |file| formatter = "--format progress" command = "rspec #{formatter} #{ENV['RSPEC_ARGS']} #{file}" sh(command) false rescue => _ true end unless failed.empty? puts("Individual tests failing: #{failed.join(' ')}") file = "failed_tests" File.write(file, failed.join("\n")) raise "Some tests are failing when ran on their own. See #{file}" end end task(:generate_team_table) do require 'json' content = ["<table id='team'>"] contributors = JSON.parse(File.read("team.json")) counter = 0 number_of_rows = 5 contributors.keys.shuffle.each do |github_user| user_content = contributors[github_user] github_user_name = user_content['name'] github_user_id = github_user_name.downcase.gsub(' ', '-') github_profile_url = "https://github.com/#{github_user}" content << "<tr>" if counter % number_of_rows == 0 content << "<td id='#{github_user_id}'>" content << "<a href='#{github_profile_url}'>" content << "<img src='#{github_profile_url}.png' width='140px;'>" content << "</a>" if user_content['twitter'] content << "<h4 align='center'><a href='https://twitter.com/#{user_content['twitter']}'>#{github_user_name}</a></h4>" else content << "<h4 align='center'>#{github_user_name}</h4>" end content << "</td>" content << "</tr>" if counter % number_of_rows == number_of_rows - 1 counter += 1 end content << "</table>" readme = File.read("README.md") readme.gsub!(%r{\<table id='team'\>.*\<\/table\>}m, content.join("\n")) File.write("README.md", readme) puts("All done") end task(:update_gem_spec_authors) do require 'json' contributors = JSON.parse(File.read("team.json")) names = contributors.values.collect do |current| current["name"] end.shuffle gemspec = File.read("fastlane.gemspec") names = names.join("\",\n \"") gemspec.gsub!(/spec.authors\s+\=\s.*?\]/m, "spec.authors = [\"#{names}\"]") File.write("fastlane.gemspec", gemspec) end task(default: :test_all) # Prepare the plugin template RuboCop config before building/installing the gem desc "Prepare .rubocop.yml for plugin template" task(:prepare_rubocop_config) do require 'yaml' require 'fileutils' lib = File.expand_path('fastlane/lib', __dir__) rubocop_config = File.expand_path('.rubocop.yml', __dir__) next unless File.exist?(rubocop_config) config = YAML.safe_load(File.read(rubocop_config), aliases: true) config['require'] = %w[rubocop/require_tools rubocop-performance] config.delete('inherit_from') config.delete('CrossPlatform/ForkUsage') config.delete('Lint/IsStringUsage') target = File.join(lib, 'fastlane/plugins/template/.rubocop.yml') FileUtils.mkdir_p(File.dirname(target)) File.write(target, YAML.dump(config)) end %w(build install release).each do |t| Rake::Task[t].enhance([:prepare_rubocop_config]) if Rake::Task.task_defined?(t) end