Skip to content

Commit 73fed15

Browse files
committed
WIP
1 parent 5250a82 commit 73fed15

File tree

3 files changed

+77
-4
lines changed

3 files changed

+77
-4
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: "Run a end to end test on the dummy gem"
2+
on: push
3+
jobs:
4+
compile:
5+
timeout-minutes: 20
6+
name: "Cross compile the gem on different ruby versions"
7+
strategy:
8+
matrix:
9+
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
10+
runs-on: "${{ matrix.os }}"
11+
steps:
12+
- name: "Checkout code"
13+
uses: "actions/checkout@v5"
14+
- name: "Setup Ruby"
15+
uses: "ruby/setup-ruby@v1"
16+
with:
17+
ruby-version: "3.0.7"
18+
bundler-cache: true
19+
working-directory: "test/fixtures/dummy_gem"
20+
- name: "Run easy compile"
21+
uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main"
22+
with:
23+
step: "compile"
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
working-directory: "test/fixtures/dummy_gem"
26+
test:
27+
timeout-minutes: 20
28+
name: "Run the test suite"
29+
needs: compile
30+
strategy:
31+
matrix:
32+
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
33+
rubies: ["3.4.7", "3.0.7"]
34+
type: ["cross", "native"]
35+
runs-on: "${{ matrix.os }}"
36+
steps:
37+
- name: "Checkout code"
38+
uses: "actions/checkout@v5"
39+
- name: "Setup Ruby"
40+
uses: "ruby/setup-ruby@v1"
41+
with:
42+
ruby-version: "${{ matrix.rubies }}"
43+
bundler-cache: true
44+
working-directory: "test/fixtures/dummy_gem"
45+
- name: "Run easy compile"
46+
uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main"
47+
with:
48+
step: "test_${{ matrix.type }}"
49+
token: ${{ secrets.GITHUB_TOKEN }} # TODO Remove this before publishing the gem
50+
working-directory: "test/fixtures/dummy_gem"
51+
install:
52+
timeout-minutes: 5
53+
name: "Verify the gem can be installed"
54+
needs: test
55+
strategy:
56+
matrix:
57+
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
58+
runs-on: "${{ matrix.os }}"
59+
steps:
60+
- name: "Setup Ruby"
61+
uses: "ruby/setup-ruby@v1"
62+
with:
63+
ruby-version: "3.4.7"
64+
- name: "Run easy compile"
65+
uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main"
66+
with:
67+
token: ${{ secrets.GITHUB_TOKEN }} # TODO Remove this before publishing the gem
68+
step: "install"

Rakefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# frozen_string_literal: true
22

33
require "bundler/gem_tasks"
4-
require "minitest/test_task"
54

6-
Minitest::TestTask.create do |t|
7-
t.test_globs = ["test/**/*_test.rb"]
5+
begin
6+
require "minitest/test_task"
7+
8+
Minitest::TestTask.create do |t|
9+
t.test_globs = ["test/**/*_test.rb"]
10+
end
11+
rescue LoadError
12+
# This begin/rescue is temporary. The gem isn't pusblished to RubyGems so to install
13+
# it the GitHub action clones the repo and runs `rake install`, without running a `bundle install` first.
814
end
915

1016
task default: :test

test/fixtures/dummy_gem/dummy_gem.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Gem::Specification.new do |spec|
1212
spec.description = "Don't use it, really."
1313
spec.homepage = "https://example.com"
1414
spec.license = "MIT"
15-
spec.required_ruby_version = ">= 3.2.0"
1615

1716
spec.metadata["allowed_push_host"] = "https://rubygems.org"
1817
spec.metadata["homepage_uri"] = spec.homepage

0 commit comments

Comments
 (0)