diff --git a/.github/actions/easy_compile/action.yml b/.github/actions/cibuildgem/action.yml similarity index 88% rename from .github/actions/easy_compile/action.yml rename to .github/actions/cibuildgem/action.yml index d4e9375..e01893c 100644 --- a/.github/actions/easy_compile/action.yml +++ b/.github/actions/cibuildgem/action.yml @@ -10,14 +10,14 @@ inputs: description: "The step to run" required: true test-command: - description: "The command to run the test suite. By default Easy Compile will run either `bundle exec rake test` or `bundle exec rake spec` depending on the test framework used." + description: "The command to run the test suite. By default cibuildgem will run either `bundle exec rake test` or `bundle exec rake spec` depending on the test framework used." required: false - default: "easy_compile test" + default: "cibuildgem test" runs: using: "composite" steps: - - name: Install easy compile # TODO this can be removed once this tool is pusblished on RubyGems + - name: Install cibuildgem # TODO this can be removed once this tool is pusblished on RubyGems shell: bash run: "rake install" working-directory: "${{ github.action_path }}" @@ -33,7 +33,7 @@ runs: if: "${{ inputs.step == 'compile' }}" working-directory: ${{ inputs.working-directory }} shell: bash - run: easy_compile package + run: cibuildgem package - name: Upload artifacts if: "${{ inputs.step == 'compile' }}" uses: actions/upload-artifact@v4 @@ -55,12 +55,12 @@ runs: if: "${{ inputs.step == 'test_cross' }}" working-directory: ${{ inputs.working-directory }} shell: bash - run: easy_compile copy_from_staging_to_lib + run: cibuildgem copy_from_staging_to_lib - name: "Compile native" if: "${{ inputs.step == 'test_native' }}" working-directory: ${{ inputs.working-directory }} shell: bash - run: easy_compile compile + run: cibuildgem compile - name: "Execute the tests" if: "${{ startsWith(inputs.step, 'test') }}" working-directory: ${{ inputs.working-directory }} @@ -86,7 +86,7 @@ runs: - name: "Push the gems to RubyGems" if: "${{ inputs.step == 'release' }}" shell: bash - run: easy_compile release --glob "pkg/*" + run: cibuildgem release --glob "pkg/*" - name: "Waiting for RubyGems to fully index the new gems" if: "${{ inputs.step == 'release' }}" shell: bash diff --git a/.github/actions/easy_compile/dist/index.js b/.github/actions/cibuildgem/dist/index.js similarity index 99% rename from .github/actions/easy_compile/dist/index.js rename to .github/actions/cibuildgem/dist/index.js index 35142d6..fc200bf 100644 --- a/.github/actions/easy_compile/dist/index.js +++ b/.github/actions/cibuildgem/dist/index.js @@ -28208,7 +28208,7 @@ const os = __nccwpck_require__(857); const path = __nccwpck_require__(6928); async function run(workingDirectory) { - let ccRubies = cp.execSync('easy_compile print_ruby_cc_version', { cwd: workingDirectory, encoding: 'utf-8' }) + let ccRubies = cp.execSync('cibuildgem print_ruby_cc_version', { cwd: workingDirectory, encoding: 'utf-8' }) await downloadRubies(ccRubies.split(':')) setupRakeCompilerConfig(workingDirectory) @@ -28231,7 +28231,7 @@ function setupRakeCompilerConfig(workingDirectory) { let rubiesRbConfig = fs.globSync(`${rubiesPath()}/*/*/lib/ruby/*/*/rbconfig.rb`) let currentRubyVersion = cp.execSync('ruby -v', { encoding: 'utf-8' }).match(/^ruby (\d\.\d\.\d)/)[1] let rbConfigPath = path.join(os.homedir(), ".rake-compiler", "config.yml") - let rubyPlatform = cp.execSync('easy_compile print_normalized_platform', { cwd: workingDirectory, encoding: 'utf-8' }) + let rubyPlatform = cp.execSync('cibuildgem print_normalized_platform', { cwd: workingDirectory, encoding: 'utf-8' }) fs.mkdirSync(`${os.homedir()}/.rake-compiler`) diff --git a/.github/actions/easy_compile/package.json b/.github/actions/cibuildgem/package.json similarity index 83% rename from .github/actions/easy_compile/package.json rename to .github/actions/cibuildgem/package.json index 49a9d9d..f1c0d40 100644 --- a/.github/actions/easy_compile/package.json +++ b/.github/actions/cibuildgem/package.json @@ -1,7 +1,7 @@ { - "name": "easy_compile", + "name": "cibuildgem", "version": "1.0.0", - "description": "A companion GitHub action for easy_compile.", + "description": "A companion GitHub action for the cibuildgem ruby tool.", "main": "index.js", "repository": "https://github.com/rails/cool-stuff-fun-time", "scripts": { diff --git a/.github/actions/easy_compile/src/index.js b/.github/actions/cibuildgem/src/index.js similarity index 91% rename from .github/actions/easy_compile/src/index.js rename to .github/actions/cibuildgem/src/index.js index 9cc645e..92bba91 100644 --- a/.github/actions/easy_compile/src/index.js +++ b/.github/actions/cibuildgem/src/index.js @@ -7,7 +7,7 @@ const os = require('os'); const path = require('path'); async function run(workingDirectory) { - let ccRubies = cp.execSync('easy_compile print_ruby_cc_version', { cwd: workingDirectory, encoding: 'utf-8' }) + let ccRubies = cp.execSync('cibuildgem print_ruby_cc_version', { cwd: workingDirectory, encoding: 'utf-8' }) await downloadRubies(ccRubies.split(':')) setupRakeCompilerConfig(workingDirectory) @@ -30,7 +30,7 @@ function setupRakeCompilerConfig(workingDirectory) { let rubiesRbConfig = fs.globSync(`${rubiesPath()}/*/*/lib/ruby/*/*/rbconfig.rb`) let currentRubyVersion = cp.execSync('ruby -v', { encoding: 'utf-8' }).match(/^ruby (\d\.\d\.\d)/)[1] let rbConfigPath = path.join(os.homedir(), ".rake-compiler", "config.yml") - let rubyPlatform = cp.execSync('easy_compile print_normalized_platform', { cwd: workingDirectory, encoding: 'utf-8' }) + let rubyPlatform = cp.execSync('cibuildgem print_normalized_platform', { cwd: workingDirectory, encoding: 'utf-8' }) fs.mkdirSync(`${os.homedir()}/.rake-compiler`) diff --git a/.github/actions/easy_compile/yarn.lock b/.github/actions/cibuildgem/yarn.lock similarity index 100% rename from .github/actions/easy_compile/yarn.lock rename to .github/actions/cibuildgem/yarn.lock diff --git a/.github/actions/easy_compile/__tests__/index.test.js b/.github/actions/easy_compile/__tests__/index.test.js deleted file mode 100644 index e810144..0000000 --- a/.github/actions/easy_compile/__tests__/index.test.js +++ /dev/null @@ -1,9 +0,0 @@ -const easyCompile = require('../src/index'); - -describe('index.js', () => { - test('when workflow pass a working_directory variable', async () => { - let foo = await easyCompile.run(); - - console.log(foo) - }) -}) diff --git a/.github/workflows/e2e-dummy-gem.yml b/.github/workflows/e2e-dummy-gem.yml index 936f230..bce5d7d 100644 --- a/.github/workflows/e2e-dummy-gem.yml +++ b/.github/workflows/e2e-dummy-gem.yml @@ -17,8 +17,8 @@ jobs: ruby-version: "3.1.7" bundler-cache: true working-directory: "test/fixtures/dummy_gem" - - name: "Run easy compile" - uses: "./.github/actions/easy_compile" + - name: "Run cibuildgem" + uses: "./.github/actions/cibuildgem" with: step: "compile" working-directory: "test/fixtures/dummy_gem" @@ -41,8 +41,8 @@ jobs: ruby-version: "${{ matrix.rubies }}" bundler-cache: true working-directory: "test/fixtures/dummy_gem" - - name: "Run easy compile" - uses: "./.github/actions/easy_compile" + - name: "Run cibuildgem" + uses: "./.github/actions/cibuildgem" with: step: "test_${{ matrix.type }}" working-directory: "test/fixtures/dummy_gem" @@ -61,7 +61,7 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "./.github/actions/easy_compile" + - name: "Run cibuildgem" + uses: "./.github/actions/cibuildgem" with: step: "install" diff --git a/.github/workflows/gem-compile.yml b/.github/workflows/gem-compile.yml index 25880f3..8802f21 100644 --- a/.github/workflows/gem-compile.yml +++ b/.github/workflows/gem-compile.yml @@ -31,8 +31,8 @@ jobs: ruby-version: "3.1.7" bundler-cache: true working-directory: "test/fixtures/date" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "compile" token: ${{ secrets.GITHUB_TOKEN }} # TODO Remove this before publishing the gem @@ -56,8 +56,8 @@ jobs: ruby-version: "${{ matrix.rubies }}" bundler-cache: true working-directory: "test/fixtures/date" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "test_${{ matrix.type }}" token: ${{ secrets.GITHUB_TOKEN }} # TODO Remove this before publishing the gem @@ -75,8 +75,8 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: token: ${{ secrets.GITHUB_TOKEN }} # TODO Remove this before publishing the gem step: "install" @@ -94,8 +94,8 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "release" token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7f8bb4a..3c521e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: run: "bundle install" - name: "Compile when target has rake as dependency" working-directory: "test/fixtures/dummy_gem" - run: "easy_compile compile" + run: "cibuildgem compile" - name: "Bundle install on target gem" working-directory: "test/fixtures/dummy_gem" run: "bundle install" @@ -41,6 +41,6 @@ jobs: BUNDLE_GEMFILE: "Gemfile_no_rake" - name: "Compile when target gem doesn't have rake as dependency" working-directory: "test/fixtures/dummy_gem" - run: "easy_compile compile" + run: "cibuildgem compile" env: BUNDLE_GEMFILE: "Gemfile_no_rake" diff --git a/.gitignore b/.gitignore index 047308c..7a1407a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ /doc/ /pkg/ /spec/reports/ -/.github/actions/easy_compile/node_modules +/.github/actions/cibuildgem/node_modules diff --git a/Gemfile b/Gemfile index f332311..1bce81c 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -# Specify your gem's dependencies in easy_compile.gemspec +# Specify your gem's dependencies in cibuildgem.gemspec gemspec gem "rake", "~> 13.0" diff --git a/Gemfile.lock b/Gemfile.lock index a4edcb9..885c2be 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - easy_compile (0.1.1) + cibuildgem (0.1.1) prism rake-compiler thor @@ -21,7 +21,7 @@ PLATFORMS ruby DEPENDENCIES - easy_compile! + cibuildgem! minitest (~> 5.16) rake (~> 13.0) diff --git a/README.md b/README.md index fe787d2..742b5fa 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,10 @@ It uses a cross compilation approach by periodically building docker images for As noted by @flavorjoes, this toolchain works great but it's complex and brittle compared to the more simple process of compiling on the target platform. -## 💻 Easy Compile +## 💻 cibuildgem > [!NOTE] -> Easy Compile is for now not able to compile projects that needs to link on external libraries. Unless the project vendors those libraries or uses [mini_portile](https://github.com/flavorjones/mini_portile). +> cibuildgem is for now not able to compile projects that needs to link on external libraries. Unless the project vendors those libraries or uses [mini_portile](https://github.com/flavorjones/mini_portile). > [!IMPORTANT] > Repositories hosted on GitHub organization that don't belong to Shopify can't be tested at the moment. This is a temporary limitation that will be lifted @@ -34,10 +34,10 @@ As noted by @flavorjoes, this toolchain works great but it's complex and brittle ### How to use it -While Easy Compile is generally **not** meant to be used locally, it provides a command to generate the right GitHub workflow for your project: +While cibuildgem is generally **not** meant to be used locally, it provides a command to generate the right GitHub workflow for your project: -1. Install Easy Compile: `git clone https://github.com/shopify-playground/edouard-playground`, `cd edouard-playground && rake install` -2. Generate the workflow: `cd` in your gem's folder and run `easy_compile ci_template` +1. Install cibuildgem: `git clone https://github.com/shopify-playground/edouard-playground`, `cd edouard-playground && rake install` +2. Generate the workflow: `cd` in your gem's folder and run `cibuildgem ci_template` 3. Commit the `.github/gem-compile.yaml` file. ### Triggering the workflow @@ -52,7 +52,7 @@ Once pushed in your repository **default** branch, the workflow that we just gen ### Changes to make in your gem to support precompiled binaries -Due to the RubyGems specification, we can't release a gem with precompiled binaries for a specific Ruby version. Because the Ruby ABI is incompatible between minor versions, Rake Compiler (the tool underneath Easy Compile), compiles the binary for every minor Ruby versions your gem supports. All those binaries will be packaged in the gem (called a fat gem) in different folder such as `3.0/date.so`, `3.1/date.so` etc... +Due to the RubyGems specification, we can't release a gem with precompiled binaries for a specific Ruby version. Because the Ruby ABI is incompatible between minor versions, Rake Compiler (the tool underneath cibuildgem), compiles the binary for every minor Ruby versions your gem supports. All those binaries will be packaged in the gem (called a fat gem) in different folder such as `3.0/date.so`, `3.1/date.so` etc... At runtime, your gem need to require the right binary based on the running ruby version. ```ruby diff --git a/bin/console b/bin/console index d004539..f24ee57 100755 --- a/bin/console +++ b/bin/console @@ -2,7 +2,7 @@ # frozen_string_literal: true require "bundler/setup" -require "easy_compile" +require "cibuildgem" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. diff --git a/easy_compile.gemspec b/cibuildgem.gemspec similarity index 83% rename from easy_compile.gemspec rename to cibuildgem.gemspec index 4bc5a28..ece4ac4 100644 --- a/easy_compile.gemspec +++ b/cibuildgem.gemspec @@ -1,10 +1,10 @@ # frozen_string_literal: true -require_relative "lib/easy_compile/version" +require_relative "lib/cibuildgem/version" Gem::Specification.new do |spec| - spec.name = "easy_compile" - spec.version = EasyCompile::VERSION + spec.name = "cibuildgem" + spec.version = Cibuildgem::VERSION spec.authors = ["Edouard CHIN"] spec.email = ["chin.edouard@gmail.com"] @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = "https://github.com" - spec.files = Dir["{exe,lib,scripts}/**/*", "LICENSE.md", "README.md", "lib/easy_compile/templates/.github/**/*"] + spec.files = Dir["{exe,lib,scripts}/**/*", "LICENSE.md", "README.md", "lib/cibuildgem/templates/.github/**/*"] spec.bindir = "exe" spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] diff --git a/exe/easy_compile b/exe/easy_compile index e8c908b..f795a5c 100755 --- a/exe/easy_compile +++ b/exe/easy_compile @@ -2,6 +2,6 @@ # frozen_string_literal: true $LOAD_PATH.unshift("#{__dir__}/../lib") -require "easy_compile" +require "cibuildgem" -EasyCompile::CLI.start(ARGV) \ No newline at end of file +Cibuildgem::CLI.start(ARGV) diff --git a/lib/cibuildgem.rb b/lib/cibuildgem.rb new file mode 100644 index 0000000..35982df --- /dev/null +++ b/lib/cibuildgem.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +require_relative "cibuildgem/version" +require_relative "cibuildgem/errors" + +module Cibuildgem + autoload :CLI, "cibuildgem/cli" + autoload :CompilationTasks, "cibuildgem/compilation_tasks" + autoload :RubySeries, "cibuildgem/ruby_series" +end diff --git a/lib/easy_compile/cli.rb b/lib/cibuildgem/cli.rb similarity index 91% rename from lib/easy_compile/cli.rb rename to lib/cibuildgem/cli.rb index 72c670a..b2c5355 100644 --- a/lib/easy_compile/cli.rb +++ b/lib/cibuildgem/cli.rb @@ -3,7 +3,7 @@ require "thor" require "rake/extensiontask" -module EasyCompile +module Cibuildgem class CLI < Thor include Thor::Actions @@ -25,12 +25,12 @@ def self.exit_on_failure? to the compilation. MSG def compile - run_rake_tasks!("easy_compile:setup", :compile) + run_rake_tasks!("cibuildgem:setup", :compile) end desc "package", "Compile and package a 'fat gem'.", hide: true long_desc <<~MSG - This command should normally run on CI, using the EasyCompile workflow. It will not work locally unless + This command should normally run on CI, using the cibuildgem workflow. It will not work locally unless the environment is properly setup. Based on a gem's gemspec, create a tailored-made Rake Compiler task to create two gems: @@ -44,12 +44,12 @@ def compile def package ENV["RUBY_CC_VERSION"] ||= compilation_task.ruby_cc_version - run_rake_tasks!("easy_compile:setup", :cross, :native, :gem) + run_rake_tasks!("cibuildgem:setup", :cross, :native, :gem) end desc "test", "Run the test suites of the target gem" long_desc <<~EOM - EasyCompile will run the test suite of the gem. It either expects a `spec` or `test` task defined. + cibuildgem will run the test suite of the gem. It either expects a `spec` or `test` task defined. EOM def test run_rake_tasks!(:test) @@ -57,7 +57,7 @@ def test desc "copy_from_staging_to_lib", "Copy the staging binary. For internal usage.", hide: true def copy_from_staging_to_lib - run_rake_tasks!("easy_compile:setup", "copy:stage:lib") + run_rake_tasks!("cibuildgem:setup", "copy:stage:lib") end desc "clean", "Cleanup temporary compilation artifacts." @@ -68,7 +68,7 @@ def copy_from_staging_to_lib to cleanup by adding files to the vanilla CLEAN rake list. MSG def clean - run_rake_tasks!("easy_compile:setup", :clean) + run_rake_tasks!("cibuildgem:setup", :clean) end desc "clobber", "Remove compiled binaries." @@ -79,7 +79,7 @@ def clean to remove by adding files to the vanilla CLOBBER rake list. MSG def clobber - run_rake_tasks!("easy_compile:setup", :clobber) + run_rake_tasks!("cibuildgem:setup", :clobber) end desc "ci_template", "Generate CI template files." diff --git a/lib/easy_compile/compilation_tasks.rb b/lib/cibuildgem/compilation_tasks.rb similarity index 96% rename from lib/easy_compile/compilation_tasks.rb rename to lib/cibuildgem/compilation_tasks.rb index ff10471..5357d65 100644 --- a/lib/easy_compile/compilation_tasks.rb +++ b/lib/cibuildgem/compilation_tasks.rb @@ -5,7 +5,7 @@ require "rake/extensiontask" require_relative "create_makefile_finder" -module EasyCompile +module Cibuildgem class CompilationTasks attr_reader :gemspec, :native, :create_packaging_task, :extension_task @@ -99,7 +99,7 @@ def find_gemspec(glob = "*.gemspec") raise GemspecError, <<~EOM Couldn't find a gemspec in the current directory. - Make sure to run any easy_compile commands in the root of your gem folder. + Make sure to run any cibuildgem commands in the root of your gem folder. EOM end diff --git a/lib/easy_compile/create_makefile_finder.rb b/lib/cibuildgem/create_makefile_finder.rb similarity index 95% rename from lib/easy_compile/create_makefile_finder.rb rename to lib/cibuildgem/create_makefile_finder.rb index 99bbefd..f7d23fd 100644 --- a/lib/easy_compile/create_makefile_finder.rb +++ b/lib/cibuildgem/create_makefile_finder.rb @@ -2,7 +2,7 @@ require "prism" -module EasyCompile +module Cibuildgem class CreateMakefileFinder < Prism::Visitor attr_reader :binary_name diff --git a/lib/easy_compile/errors.rb b/lib/cibuildgem/errors.rb similarity index 80% rename from lib/easy_compile/errors.rb rename to lib/cibuildgem/errors.rb index 5a5cd5a..73550ca 100644 --- a/lib/easy_compile/errors.rb +++ b/lib/cibuildgem/errors.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -module EasyCompile +module Cibuildgem GemspecError = Class.new(StandardError) end diff --git a/lib/easy_compile/ruby_series.rb b/lib/cibuildgem/ruby_series.rb similarity index 98% rename from lib/easy_compile/ruby_series.rb rename to lib/cibuildgem/ruby_series.rb index 99671ce..d34b853 100644 --- a/lib/easy_compile/ruby_series.rb +++ b/lib/cibuildgem/ruby_series.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module EasyCompile +module Cibuildgem module RubySeries extend self diff --git a/lib/easy_compile/tasks/wrapper.rake b/lib/cibuildgem/tasks/wrapper.rake similarity index 86% rename from lib/easy_compile/tasks/wrapper.rake rename to lib/cibuildgem/tasks/wrapper.rake index f4670e4..9d27231 100644 --- a/lib/easy_compile/tasks/wrapper.rake +++ b/lib/cibuildgem/tasks/wrapper.rake @@ -2,9 +2,9 @@ require_relative "../compilation_tasks" -task = EasyCompile::CompilationTasks.new(!Rake::Task.task_defined?(:package)) +task = Cibuildgem::CompilationTasks.new(!Rake::Task.task_defined?(:package)) -task "easy_compile:setup" do +task "cibuildgem:setup" do Rake.application.instance_variable_get(:@tasks).delete_if do |name, _| name == "native:#{task.gemspec.name}:#{task.normalized_platform}" end diff --git a/lib/easy_compile/templates/.github/workflows/easy-compile.yaml.tt b/lib/cibuildgem/templates/.github/workflows/cibuildgem.yaml.tt similarity index 92% rename from lib/easy_compile/templates/.github/workflows/easy-compile.yaml.tt rename to lib/cibuildgem/templates/.github/workflows/cibuildgem.yaml.tt index f4fc935..f072b96 100644 --- a/lib/easy_compile/templates/.github/workflows/easy-compile.yaml.tt +++ b/lib/cibuildgem/templates/.github/workflows/cibuildgem.yaml.tt @@ -26,8 +26,8 @@ jobs: <%- if options['working-directory'] -%> working-directory: "<%= options['working-directory'] %>" <%- end -%> - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "compile" <%- if options['working-directory'] -%> @@ -54,8 +54,8 @@ jobs: <%- if options['working-directory'] -%> working-directory: "<%= options['working-directory'] %>" <%- end -%> - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "test_${{ matrix.type }}" <%- if options['working-directory'] -%> @@ -77,8 +77,8 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "<%= latest_supported_ruby_version %>" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "install" release: @@ -95,7 +95,7 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "release" diff --git a/lib/easy_compile/version.rb b/lib/cibuildgem/version.rb similarity index 74% rename from lib/easy_compile/version.rb rename to lib/cibuildgem/version.rb index 552e1fc..717c4f7 100644 --- a/lib/easy_compile/version.rb +++ b/lib/cibuildgem/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -module EasyCompile +module Cibuildgem VERSION = "0.1.1" end diff --git a/lib/easy_compile.rb b/lib/easy_compile.rb deleted file mode 100644 index 1aac2d3..0000000 --- a/lib/easy_compile.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -require_relative "easy_compile/version" -require_relative "easy_compile/errors" - -module EasyCompile - autoload :CLI, "easy_compile/cli" - autoload :CompilationTasks, "easy_compile/compilation_tasks" - autoload :RubySeries, "easy_compile/ruby_series" -end diff --git a/test/cli_test.rb b/test/cli_test.rb index 1c13c3d..b55b600 100644 --- a/test/cli_test.rb +++ b/test/cli_test.rb @@ -2,7 +2,7 @@ require "test_helper" -module EasyCompile +module Cibuildgem class CLITest < Minitest::Test def setup super @@ -59,7 +59,7 @@ def test_clobber end def test_ci_template - workflow_path = "test/fixtures/dummy_gem/.github/workflows/easy-compile.yaml" + workflow_path = "test/fixtures/dummy_gem/.github/workflows/cibuildgem.yaml" expected_workflow = File.read("test/fixtures/expected_github_workflow.yml") Dir.chdir("test/fixtures/dummy_gem") do @@ -75,7 +75,7 @@ def test_ci_template end def test_ci_template_when_passed_a_working_directory - workflow_path = "test/fixtures/dummy_gem/.github/workflows/easy-compile.yaml" + workflow_path = "test/fixtures/dummy_gem/.github/workflows/cibuildgem.yaml" expected_workflow = File.read("test/fixtures/expected_github_workflow_working_dir.yml") Dir.chdir("test/fixtures/dummy_gem") do @@ -91,7 +91,7 @@ def test_ci_template_when_passed_a_working_directory end def test_ci_template_when_passed_a_test_command - workflow_path = "test/fixtures/dummy_gem/.github/workflows/easy-compile.yaml" + workflow_path = "test/fixtures/dummy_gem/.github/workflows/cibuildgem.yaml" expected_workflow = File.read("test/fixtures/expected_github_workflow_test_command.yml") Dir.chdir("test/fixtures/dummy_gem") do @@ -107,7 +107,7 @@ def test_ci_template_when_passed_a_test_command end def test_ci_template_when_passed_a_test_command_and_workdir - workflow_path = "test/fixtures/dummy_gem/.github/workflows/easy-compile.yaml" + workflow_path = "test/fixtures/dummy_gem/.github/workflows/cibuildgem.yaml" expected_workflow = File.read("test/fixtures/expected_github_workflow_test_and_workdir.yml") Dir.chdir("test/fixtures/dummy_gem") do @@ -163,7 +163,7 @@ def test_when_cli_runs_in_project_with_no_gemspec assert_equal(<<~MSG, out) Couldn't find a gemspec in the current directory. - Make sure to run any easy_compile commands in the root of your gem folder. + Make sure to run any cibuildgem commands in the root of your gem folder. MSG end diff --git a/test/fixtures/expected_github_workflow.yml b/test/fixtures/expected_github_workflow.yml index 866e182..55459ea 100644 --- a/test/fixtures/expected_github_workflow.yml +++ b/test/fixtures/expected_github_workflow.yml @@ -23,8 +23,8 @@ jobs: with: ruby-version: "3.1.7" bundler-cache: true - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "compile" test: @@ -45,8 +45,8 @@ jobs: with: ruby-version: "${{ matrix.rubies }}" bundler-cache: true - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "test_${{ matrix.type }}" install: @@ -62,8 +62,8 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "install" release: @@ -80,7 +80,7 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "release" diff --git a/test/fixtures/expected_github_workflow_test_and_workdir.yml b/test/fixtures/expected_github_workflow_test_and_workdir.yml index 2336b8b..35c9cf3 100644 --- a/test/fixtures/expected_github_workflow_test_and_workdir.yml +++ b/test/fixtures/expected_github_workflow_test_and_workdir.yml @@ -24,8 +24,8 @@ jobs: ruby-version: "3.1.7" bundler-cache: true working-directory: "foo/bar" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "compile" working-directory: "foo/bar" @@ -48,8 +48,8 @@ jobs: ruby-version: "${{ matrix.rubies }}" bundler-cache: true working-directory: "foo/bar" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "test_${{ matrix.type }}" working-directory: "foo/bar" @@ -67,8 +67,8 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "install" release: @@ -85,7 +85,7 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "release" diff --git a/test/fixtures/expected_github_workflow_test_command.yml b/test/fixtures/expected_github_workflow_test_command.yml index 26c67a6..e950148 100644 --- a/test/fixtures/expected_github_workflow_test_command.yml +++ b/test/fixtures/expected_github_workflow_test_command.yml @@ -23,8 +23,8 @@ jobs: with: ruby-version: "3.1.7" bundler-cache: true - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "compile" test: @@ -45,8 +45,8 @@ jobs: with: ruby-version: "${{ matrix.rubies }}" bundler-cache: true - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "test_${{ matrix.type }}" test-command: "bundle exec something" @@ -63,8 +63,8 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "install" release: @@ -81,7 +81,7 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "release" diff --git a/test/fixtures/expected_github_workflow_working_dir.yml b/test/fixtures/expected_github_workflow_working_dir.yml index 01f6878..fd2c623 100644 --- a/test/fixtures/expected_github_workflow_working_dir.yml +++ b/test/fixtures/expected_github_workflow_working_dir.yml @@ -24,8 +24,8 @@ jobs: ruby-version: "3.1.7" bundler-cache: true working-directory: "test/fixtures/date" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "compile" working-directory: "test/fixtures/date" @@ -48,8 +48,8 @@ jobs: ruby-version: "${{ matrix.rubies }}" bundler-cache: true working-directory: "test/fixtures/date" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "test_${{ matrix.type }}" working-directory: "test/fixtures/date" @@ -66,8 +66,8 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "install" release: @@ -84,7 +84,7 @@ jobs: uses: "ruby/setup-ruby@v1" with: ruby-version: "3.4.7" - - name: "Run easy compile" - uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" + - name: "Run cibuildgem" + uses: "shopify-playground/edouard-playground/.github/actions/cibuildgem@main" with: step: "release" diff --git a/test/ruby_series_test.rb b/test/ruby_series_test.rb index 139a9e4..b633117 100644 --- a/test/ruby_series_test.rb +++ b/test/ruby_series_test.rb @@ -2,7 +2,7 @@ require "test_helper" -module EasyCompile +module Cibuildgem class RubySeriesTest < Minitest::Test def test_latest_version_for_requirements requirements = Gem::Requirement.new("~> 3.4") diff --git a/test/test_easy_compile.rb b/test/test_easy_compile.rb deleted file mode 100644 index 54ca425..0000000 --- a/test/test_easy_compile.rb +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -require "test_helper" - -class TestEasyCompile < Minitest::Test -end diff --git a/test/test_helper.rb b/test/test_helper.rb index 6347bba..7bea66f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true $LOAD_PATH.unshift File.expand_path("../lib", __dir__) -require "easy_compile" +require "cibuildgem" require "minitest/autorun"