danger-spm_version_updates 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -3
- data/danger-spm_version_updates.gemspec +1 -1
- data/lib/spm_version_updates/gem_version.rb +1 -1
- data/lib/spm_version_updates/git.rb +56 -0
- data/lib/spm_version_updates/plugin.rb +19 -97
- data/lib/spm_version_updates/xcode.rb +67 -0
- metadata +4 -27
- data/.editorconfig +0 -15
- data/.github/workflows/docs.yml +0 -43
- data/.github/workflows/lint_and_test.yml +0 -32
- data/.github/workflows/push_gem.yml +0 -26
- data/.github/workflows/readme.yml +0 -21
- data/.gitignore +0 -136
- data/.idea/.gitignore +0 -8
- data/.idea/danger-plugin-spm-version-updates.iml +0 -130
- data/.idea/misc.xml +0 -4
- data/.idea/modules.xml +0 -8
- data/.idea/vcs.xml +0 -6
- data/.markdownlint.jsonc +0 -6
- data/.reek.yml +0 -129
- data/.rubocop.yml +0 -501
- data/spec/spec_helper.rb +0 -61
- data/spec/spm_version_updates_spec.rb +0 -180
- data/spec/support/fixtures/Branch.xcodeproj/project.pbxproj +0 -80
- data/spec/support/fixtures/Branch.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +0 -265
- data/spec/support/fixtures/ExactVersion.xcodeproj/project.pbxproj +0 -80
- data/spec/support/fixtures/ExactVersion.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +0 -265
- data/spec/support/fixtures/UpToNextMajor.xcodeproj/project.pbxproj +0 -80
- data/spec/support/fixtures/UpToNextMajor.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +0 -265
- data/spec/support/fixtures/VersionRange.xcodeproj/project.pbxproj +0 -81
- data/spec/support/fixtures/VersionRange.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +0 -265
- data/spec/support/fixtures/github_pr.json +0 -268
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45434b8470d53708ee3261e6415b61eb6ca22dd4c3bd2080cbb0f28014c48276
|
4
|
+
data.tar.gz: c41a9d67f408fdaeaec72bdca65a8b0abefd998c0e852d9ce1f4c4ed76bda79c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 949714767a85ebbf99c10aa1e8b424344a54a0cd3d8c7e1dcaae759b3f656a92f45b6df6adf9bf90468448f80636025ec659758c9309bf1a3c723f2c24ccfe18
|
7
|
+
data.tar.gz: 75e265f2a49a1efddae3c0272818ef67e2254739ce100bf3551306e670fe0e7e9fc5b608a49e91aa7b218bde1a92ae2d856ee87bd8e58276d4d01d53e18932ee
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -15,7 +15,9 @@ Note that version 0.1.0 is the last version to support Ruby 2.7
|
|
15
15
|
|
16
16
|
## Installation
|
17
17
|
|
18
|
-
|
18
|
+
```sh
|
19
|
+
gem install danger-spm_version_updates
|
20
|
+
```
|
19
21
|
|
20
22
|
or add the following to your Gemfile:
|
21
23
|
|
@@ -43,7 +45,7 @@ spm_version_updates.report_above_maximum = true
|
|
43
45
|
# Whether to report pre-release versions, default false
|
44
46
|
spm_version_updates.report_pre_releases = true
|
45
47
|
|
46
|
-
# A list of
|
48
|
+
# A list of repository URLs for packages to ignore entirely
|
47
49
|
spm_version_updates.ignore_repos = ["https://github.com/pointfreeco/swift-snapshot-testing"]
|
48
50
|
```
|
49
51
|
|
@@ -63,7 +65,7 @@ spm_version_updates.ignore_repos = ["https://github.com/pointfreeco/swift-snapsh
|
|
63
65
|
|
64
66
|
Swift and the Swift logo are trademarks of Apple Inc.
|
65
67
|
|
66
|
-
Copyright (c) 2023 Harold Martin
|
68
|
+
Copyright (c) 2023 Harold Martin
|
67
69
|
|
68
70
|
MIT License
|
69
71
|
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.license = "MIT"
|
16
16
|
spec.required_ruby_version = ">= 3.0"
|
17
17
|
|
18
|
-
spec.files =
|
18
|
+
spec.files = Dir['lib/*'] + Dir['lib/**/*'] + Dir['*']
|
19
19
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
spec.metadata["rubygems_mfa_required"] = "true"
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Git
|
4
|
+
# Removes protocol and trailing .git from a repo URL
|
5
|
+
# @param [String] repo_url
|
6
|
+
# The URL of the repository
|
7
|
+
# @return [String]
|
8
|
+
def self.trim_repo_url(repo_url)
|
9
|
+
repo_url.split("://").last.gsub(/\.git$/, "")
|
10
|
+
end
|
11
|
+
|
12
|
+
# Extract a readable name for the repo given the url, generally org/repo
|
13
|
+
# @return [String]
|
14
|
+
def self.repo_name(repo_url)
|
15
|
+
match = repo_url.match(%r{([\w-]+/[\w-]+)(.git)?$})
|
16
|
+
|
17
|
+
if match
|
18
|
+
match[1] || match[0]
|
19
|
+
else
|
20
|
+
repo_url
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Call git to list tags
|
25
|
+
# @param [String] repo_url
|
26
|
+
# The URL of the dependency's repository
|
27
|
+
# @return [Array<Semantic::Version>]
|
28
|
+
def self.version_tags(repo_url)
|
29
|
+
versions = `git ls-remote -t #{repo_url}`
|
30
|
+
.split("\n")
|
31
|
+
.map { |line| line.split("/tags/").last }
|
32
|
+
.filter_map { |line|
|
33
|
+
begin
|
34
|
+
Semantic::Version.new(line)
|
35
|
+
rescue ArgumentError
|
36
|
+
nil
|
37
|
+
end
|
38
|
+
}
|
39
|
+
versions.sort!
|
40
|
+
versions.reverse!
|
41
|
+
versions
|
42
|
+
end
|
43
|
+
|
44
|
+
# Call git to find the last commit on a branch
|
45
|
+
# @param [String] repo_url
|
46
|
+
# The URL of the dependency's repository
|
47
|
+
# @param [String] branch_name
|
48
|
+
# The name of the branch on which to find the last commit
|
49
|
+
# @return [String]
|
50
|
+
def self.branch_last_commit(repo_url, branch_name)
|
51
|
+
`git ls-remote -h #{repo_url}`
|
52
|
+
.split("\n")
|
53
|
+
.find { |line| line.split("\trefs/heads/")[1] == branch_name }
|
54
|
+
.split("\trefs/heads/")[0]
|
55
|
+
end
|
56
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "semantic"
|
4
|
-
|
4
|
+
require_relative "git"
|
5
|
+
require_relative "xcode"
|
5
6
|
|
6
7
|
module Danger
|
7
|
-
# A plugin for checking if there are versions upgrades available for SPM
|
8
|
+
# A Danger plugin for checking if there are versions upgrades available for SPM dependencies
|
8
9
|
#
|
9
10
|
# @example Check if MyApp's SPM dependencies are up to date
|
10
|
-
#
|
11
11
|
# spm_version_updates.check_for_updates("MyApp.xcodeproj")
|
12
12
|
#
|
13
|
-
# @see
|
13
|
+
# @see hbmartin/danger-spm_version_updates
|
14
14
|
# @tags swift, spm, swift package manager, xcode, xcodeproj, version, updates
|
15
15
|
#
|
16
16
|
class DangerSpmVersionUpdates < Plugin
|
@@ -26,35 +26,42 @@ module Danger
|
|
26
26
|
# @return [Boolean]
|
27
27
|
attr_accessor :report_pre_releases
|
28
28
|
|
29
|
-
# A list of
|
29
|
+
# A list of repository URLs for packages to ignore entirely
|
30
30
|
# @return [Array<String>]
|
31
31
|
attr_accessor :ignore_repos
|
32
32
|
|
33
33
|
# A method that you can call from your Dangerfile
|
34
34
|
# @param [String] xcodeproj_path
|
35
35
|
# The path to your Xcode project
|
36
|
+
# @raise [XcodeprojPathMustBeSet] if the xcodeproj_path is blank
|
36
37
|
# @return [void]
|
37
38
|
def check_for_updates(xcodeproj_path)
|
38
|
-
remote_packages =
|
39
|
-
resolved_versions = get_resolved_versions(xcodeproj_path)
|
39
|
+
remote_packages = Xcode.get_packages(xcodeproj_path)
|
40
|
+
resolved_versions = Xcode.get_resolved_versions(xcodeproj_path)
|
41
|
+
$stderr.puts("Found resolved versions for #{resolved_versions.size} packages")
|
42
|
+
|
43
|
+
self.ignore_repos = self.ignore_repos&.map! { |repo| Git.trim_repo_url(repo) }
|
40
44
|
|
41
45
|
remote_packages.each { |repository_url, requirement|
|
42
|
-
next if ignore_repos&.include?(repository_url)
|
46
|
+
next if self.ignore_repos&.include?(repository_url)
|
43
47
|
|
44
|
-
name = repo_name(repository_url)
|
48
|
+
name = Git.repo_name(repository_url)
|
45
49
|
resolved_version = resolved_versions[repository_url]
|
46
50
|
kind = requirement["kind"]
|
47
51
|
|
48
|
-
|
52
|
+
if resolved_version.nil?
|
53
|
+
$stderr.puts("Unable to locate the current version for #{name} (#{repository_url})")
|
54
|
+
next
|
55
|
+
end
|
49
56
|
|
50
57
|
if kind == "branch"
|
51
58
|
branch = requirement["branch"]
|
52
|
-
last_commit =
|
59
|
+
last_commit = Git.branch_last_commit(repository_url, branch)
|
53
60
|
warn("Newer commit available for #{name} (#{branch}): #{last_commit}") unless last_commit == resolved_version
|
54
61
|
next
|
55
62
|
end
|
56
63
|
|
57
|
-
available_versions =
|
64
|
+
available_versions = Git.version_tags(repository_url)
|
58
65
|
next if available_versions.first.to_s == resolved_version
|
59
66
|
|
60
67
|
if kind == "exactVersion" && @check_when_exact
|
@@ -69,60 +76,6 @@ module Danger
|
|
69
76
|
}
|
70
77
|
end
|
71
78
|
|
72
|
-
# Extracts remote packages from an Xcode project
|
73
|
-
# @param [String] xcodeproj_path
|
74
|
-
# The path to your Xcode project
|
75
|
-
# @return [Hash<String, Hash>]
|
76
|
-
def get_remote_package(xcodeproj_path)
|
77
|
-
raise(XcodeprojPathMustBeSet) if xcodeproj_path.nil?
|
78
|
-
|
79
|
-
filter_remote_packages(Xcodeproj::Project.open(xcodeproj_path))
|
80
|
-
end
|
81
|
-
|
82
|
-
# Extracts resolved versions from Package.resolved relative to an Xcode project
|
83
|
-
# @param [String] xcodeproj_path
|
84
|
-
# The path to your Xcode project
|
85
|
-
# @return [Hash<String, String>]
|
86
|
-
def get_resolved_versions(xcodeproj_path)
|
87
|
-
resolved_path = find_packages_resolved_file(xcodeproj_path)
|
88
|
-
raise(CouldNotFindResolvedFile) unless File.exist?(resolved_path)
|
89
|
-
|
90
|
-
JSON.load_file!(resolved_path)["pins"]
|
91
|
-
.to_h { |pin| [pin["location"], pin["state"]["version"] || pin["state"]["revision"]] }
|
92
|
-
end
|
93
|
-
|
94
|
-
# Extract a readable name for the repo given the url, generally org/repo
|
95
|
-
# @return [String]
|
96
|
-
def repo_name(repo_url)
|
97
|
-
match = repo_url.match(%r{([\w-]+/[\w-]+)(.git)?$})
|
98
|
-
|
99
|
-
if match
|
100
|
-
match[1] || match[0]
|
101
|
-
else
|
102
|
-
repo_url
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
# Find the configured SPM dependencies in the xcodeproj
|
107
|
-
# @return [Hash<String, Hash>]
|
108
|
-
def filter_remote_packages(project)
|
109
|
-
project.objects.select { |obj|
|
110
|
-
obj.kind_of?(Xcodeproj::Project::Object::XCRemoteSwiftPackageReference) &&
|
111
|
-
obj.requirement["kind"] != "commit"
|
112
|
-
}
|
113
|
-
.to_h { |package| [package.repositoryURL, package.requirement] }
|
114
|
-
end
|
115
|
-
|
116
|
-
# Find the Packages.resolved file
|
117
|
-
# @return [String]
|
118
|
-
def find_packages_resolved_file(xcodeproj_path)
|
119
|
-
if Dir.exist?(xcodeproj_path.sub("xcodeproj", "xcworkspace"))
|
120
|
-
File.join(xcodeproj_path.sub("xcodeproj", "xcworkspace"), "xcshareddata", "swiftpm", "Package.resolved")
|
121
|
-
else
|
122
|
-
File.join(xcodeproj_path, "project.xcworkspace", "xcshareddata", "swiftpm", "Package.resolved")
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
79
|
private
|
127
80
|
|
128
81
|
def warn_for_new_versions_exact(available_versions, name, resolved_version)
|
@@ -171,36 +124,5 @@ Newest version of #{name}: #{available_versions.first} (but this package is conf
|
|
171
124
|
TEXT
|
172
125
|
) unless newest_above_reqs == newest_meeting_reqs || newest_meeting_reqs.to_s == resolved_version
|
173
126
|
end
|
174
|
-
|
175
|
-
# Remove git call to list tags
|
176
|
-
# @return [Array<Semantic::Version>]
|
177
|
-
def git_versions(repo_url)
|
178
|
-
versions = `git ls-remote -t #{repo_url}`
|
179
|
-
.split("\n")
|
180
|
-
.map { |line| line.split("/tags/").last }
|
181
|
-
.filter_map { |line|
|
182
|
-
begin
|
183
|
-
Semantic::Version.new(line)
|
184
|
-
rescue ArgumentError
|
185
|
-
nil
|
186
|
-
end
|
187
|
-
}
|
188
|
-
versions.sort!
|
189
|
-
versions.reverse!
|
190
|
-
versions
|
191
|
-
end
|
192
|
-
|
193
|
-
def git_branch_last_commit(repo_url, branch_name)
|
194
|
-
`git ls-remote -h #{repo_url}`
|
195
|
-
.split("\n")
|
196
|
-
.find { |line| line.split("\trefs/heads/")[1] == branch_name }
|
197
|
-
.split("\trefs/heads/")[0]
|
198
|
-
end
|
199
|
-
end
|
200
|
-
|
201
|
-
class XcodeprojPathMustBeSet < StandardError
|
202
|
-
end
|
203
|
-
|
204
|
-
class CouldNotFindResolvedFile < StandardError
|
205
127
|
end
|
206
128
|
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "xcodeproj"
|
4
|
+
|
5
|
+
module Xcode
|
6
|
+
# Find the configured SPM dependencies in the xcodeproj
|
7
|
+
# @param [String] xcodeproj_path
|
8
|
+
# The path of the Xcode project
|
9
|
+
# @return [Hash<String, Hash>]
|
10
|
+
def self.get_packages(xcodeproj_path)
|
11
|
+
raise(XcodeprojPathMustBeSet) if xcodeproj_path.nil? || xcodeproj_path.empty?
|
12
|
+
|
13
|
+
project = Xcodeproj::Project.open(xcodeproj_path)
|
14
|
+
project.objects.select { |obj|
|
15
|
+
obj.kind_of?(Xcodeproj::Project::Object::XCRemoteSwiftPackageReference) &&
|
16
|
+
obj.requirement["kind"] != "commit"
|
17
|
+
}
|
18
|
+
.to_h { |package|
|
19
|
+
[Git.trim_repo_url(package.repositoryURL), package.requirement]
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
# Extracts resolved versions from Package.resolved relative to an Xcode project
|
24
|
+
# @param [String] xcodeproj_path
|
25
|
+
# The path to your Xcode project
|
26
|
+
# @raise [CouldNotFindResolvedFile] if no Package.resolved files were found
|
27
|
+
# @return [Hash<String, String>]
|
28
|
+
def self.get_resolved_versions(xcodeproj_path)
|
29
|
+
resolved_paths = find_packages_resolved_file(xcodeproj_path)
|
30
|
+
raise(CouldNotFindResolvedFile) if resolved_paths.empty?
|
31
|
+
|
32
|
+
resolved_versions = resolved_paths.map { |resolved_path|
|
33
|
+
JSON.load_file!(resolved_path)["pins"]
|
34
|
+
.to_h { |pin|
|
35
|
+
[Git.trim_repo_url(pin["location"]), pin["state"]["version"] || pin["state"]["revision"]]
|
36
|
+
}
|
37
|
+
}
|
38
|
+
resolved_versions.reduce(:merge!)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Find the Packages.resolved file
|
42
|
+
# @return [Array<String>]
|
43
|
+
def self.find_packages_resolved_file(xcodeproj_path)
|
44
|
+
locations = []
|
45
|
+
# First check the workspace for a resolved file
|
46
|
+
workspace = xcodeproj_path.sub("xcodeproj", "xcworkspace")
|
47
|
+
if Dir.exist?(workspace)
|
48
|
+
path = File.join(workspace, "xcshareddata", "swiftpm", "Package.resolved")
|
49
|
+
locations << path if File.exist?(path)
|
50
|
+
end
|
51
|
+
|
52
|
+
# Then check the project for a resolved file
|
53
|
+
path = File.join(xcodeproj_path, "project.xcworkspace", "xcshareddata", "swiftpm", "Package.resolved")
|
54
|
+
locations << path if File.exist?(path)
|
55
|
+
|
56
|
+
$stderr.puts("Searching for resolved packages in: #{locations}")
|
57
|
+
locations
|
58
|
+
end
|
59
|
+
|
60
|
+
private_class_method :find_packages_resolved_file
|
61
|
+
|
62
|
+
class XcodeprojPathMustBeSet < StandardError
|
63
|
+
end
|
64
|
+
|
65
|
+
class CouldNotFindResolvedFile < StandardError
|
66
|
+
end
|
67
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-spm_version_updates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harold Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -284,20 +284,6 @@ executables: []
|
|
284
284
|
extensions: []
|
285
285
|
extra_rdoc_files: []
|
286
286
|
files:
|
287
|
-
- ".editorconfig"
|
288
|
-
- ".github/workflows/docs.yml"
|
289
|
-
- ".github/workflows/lint_and_test.yml"
|
290
|
-
- ".github/workflows/push_gem.yml"
|
291
|
-
- ".github/workflows/readme.yml"
|
292
|
-
- ".gitignore"
|
293
|
-
- ".idea/.gitignore"
|
294
|
-
- ".idea/danger-plugin-spm-version-updates.iml"
|
295
|
-
- ".idea/misc.xml"
|
296
|
-
- ".idea/modules.xml"
|
297
|
-
- ".idea/vcs.xml"
|
298
|
-
- ".markdownlint.jsonc"
|
299
|
-
- ".reek.yml"
|
300
|
-
- ".rubocop.yml"
|
301
287
|
- CODE_OF_CONDUCT.md
|
302
288
|
- Gemfile
|
303
289
|
- Gemfile.lock
|
@@ -309,18 +295,9 @@ files:
|
|
309
295
|
- lib/danger_plugin.rb
|
310
296
|
- lib/danger_spm_version_updates.rb
|
311
297
|
- lib/spm_version_updates/gem_version.rb
|
298
|
+
- lib/spm_version_updates/git.rb
|
312
299
|
- lib/spm_version_updates/plugin.rb
|
313
|
-
-
|
314
|
-
- spec/spm_version_updates_spec.rb
|
315
|
-
- spec/support/fixtures/Branch.xcodeproj/project.pbxproj
|
316
|
-
- spec/support/fixtures/Branch.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
|
317
|
-
- spec/support/fixtures/ExactVersion.xcodeproj/project.pbxproj
|
318
|
-
- spec/support/fixtures/ExactVersion.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
|
319
|
-
- spec/support/fixtures/UpToNextMajor.xcodeproj/project.pbxproj
|
320
|
-
- spec/support/fixtures/UpToNextMajor.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
|
321
|
-
- spec/support/fixtures/VersionRange.xcodeproj/project.pbxproj
|
322
|
-
- spec/support/fixtures/VersionRange.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
|
323
|
-
- spec/support/fixtures/github_pr.json
|
300
|
+
- lib/spm_version_updates/xcode.rb
|
324
301
|
homepage: https://github.com/hbmartin/danger-spm_version_updates
|
325
302
|
licenses:
|
326
303
|
- MIT
|
data/.editorconfig
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
root = true
|
2
|
-
|
3
|
-
[*]
|
4
|
-
end_of_line = lf
|
5
|
-
insert_final_newline = true
|
6
|
-
charset = utf-8
|
7
|
-
trim_trailing_whitespace = true
|
8
|
-
|
9
|
-
[*.{rb,yml,gemspec}]
|
10
|
-
indent_style = space
|
11
|
-
indent_size = 2
|
12
|
-
|
13
|
-
[Dangerfile, Rakefile, Guardfile, Gemfile]
|
14
|
-
indent_style = space
|
15
|
-
indent_size = 2
|
data/.github/workflows/docs.yml
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
name: Publish Yard HTML to GitHub Pages
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- "*"
|
7
|
-
workflow_dispatch:
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
build:
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
steps:
|
13
|
-
- uses: actions/checkout@v3
|
14
|
-
- name: Set up Ruby
|
15
|
-
uses: ruby/setup-ruby@v1
|
16
|
-
with:
|
17
|
-
ruby-version: 3.2
|
18
|
-
bundler-cache: true
|
19
|
-
- name: Build HTML docs
|
20
|
-
run: bundle exec yard
|
21
|
-
- name: Upload artifact
|
22
|
-
uses: actions/upload-pages-artifact@v2
|
23
|
-
with:
|
24
|
-
path: ./doc
|
25
|
-
deploy:
|
26
|
-
needs: build
|
27
|
-
|
28
|
-
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
|
29
|
-
permissions:
|
30
|
-
pages: write # to deploy to Pages
|
31
|
-
id-token: write # to verify the deployment originates from an appropriate source
|
32
|
-
|
33
|
-
# Deploy to the github-pages environment
|
34
|
-
environment:
|
35
|
-
name: github-pages
|
36
|
-
url: ${{ steps.deployment.outputs.page_url }}
|
37
|
-
|
38
|
-
# Specify runner + deployment step
|
39
|
-
runs-on: ubuntu-latest
|
40
|
-
steps:
|
41
|
-
- name: Deploy to GitHub Pages
|
42
|
-
id: deployment
|
43
|
-
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action
|
@@ -1,32 +0,0 @@
|
|
1
|
-
name: CI
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [ main ]
|
6
|
-
pull_request:
|
7
|
-
branches: [ main ]
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
build:
|
11
|
-
strategy:
|
12
|
-
matrix:
|
13
|
-
ruby-version:
|
14
|
-
- "3.0"
|
15
|
-
- "3.1"
|
16
|
-
- "3.2"
|
17
|
-
runs-on: ubuntu-latest
|
18
|
-
steps:
|
19
|
-
- uses: actions/checkout@v4
|
20
|
-
- name: Set up Ruby
|
21
|
-
uses: ruby/setup-ruby@v1
|
22
|
-
with:
|
23
|
-
ruby-version: ${{ matrix.ruby-version }}
|
24
|
-
bundler-cache: true
|
25
|
-
- name: Running Tests
|
26
|
-
run: bundle exec rake spec
|
27
|
-
- name: Upload coverage reports to Codecov
|
28
|
-
uses: codecov/codecov-action@v4
|
29
|
-
with:
|
30
|
-
fail_ci_if_error: true
|
31
|
-
env:
|
32
|
-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
name: Push Gem
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- v*
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
push:
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
|
12
|
-
permissions:
|
13
|
-
contents: write
|
14
|
-
id-token: write
|
15
|
-
|
16
|
-
steps:
|
17
|
-
# Set up
|
18
|
-
- uses: actions/checkout@v4
|
19
|
-
- name: Set up Ruby
|
20
|
-
uses: ruby/setup-ruby@v1
|
21
|
-
with:
|
22
|
-
bundler-cache: true
|
23
|
-
ruby-version: ruby
|
24
|
-
|
25
|
-
# Release
|
26
|
-
- uses: rubygems/release-gem@v1
|
@@ -1,21 +0,0 @@
|
|
1
|
-
name: Readme formatting and typo checking
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: ["main"]
|
6
|
-
pull_request:
|
7
|
-
branches: ["main"]
|
8
|
-
|
9
|
-
jobs:
|
10
|
-
lint:
|
11
|
-
runs-on: ubuntu-latest
|
12
|
-
steps:
|
13
|
-
- name: Check out repository code
|
14
|
-
uses: actions/checkout@v4
|
15
|
-
- name: Markdown Lint
|
16
|
-
uses: avto-dev/markdown-lint@v1.5.0
|
17
|
-
with:
|
18
|
-
args: "./README.md"
|
19
|
-
config: "./.markdownlint.jsonc"
|
20
|
-
- name: Typos
|
21
|
-
uses: crate-ci/typos@v1.19.0
|