Skip to content

Commit 9891327

Browse files
committed
Let's get builds and tests working!
1 parent 6cd6ebf commit 9891327

File tree

2 files changed

+90
-100
lines changed

2 files changed

+90
-100
lines changed

.github/workflows/ci.yml

Lines changed: 90 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -2,141 +2,132 @@ name: CI
22

33
on:
44
push:
5-
branches: [main, master]
5+
branches: [main]
66
pull_request:
7-
branches: [main, master]
7+
branches: [main]
88

99
jobs:
10-
test-linux:
11-
runs-on: ubuntu-latest
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
ruby: ['3.0', '3.1', '3.2', '3.3']
16-
17-
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Set up Ruby ${{ matrix.ruby }}
21-
uses: ruby/setup-ruby@v1
22-
with:
23-
ruby-version: ${{ matrix.ruby }}
24-
bundler-cache: true
25-
26-
- name: Install dependencies
27-
run: bundle install
28-
29-
- name: Compile extension
30-
run: bundle exec rake compile
31-
32-
- name: Run tests
33-
run: bundle exec rake test
34-
35-
test-macos:
36-
runs-on: macos-latest
37-
strategy:
38-
fail-fast: false
39-
matrix:
40-
ruby: ['3.1', '3.2', '3.3']
41-
42-
steps:
43-
- uses: actions/checkout@v4
44-
45-
- name: Set up Ruby ${{ matrix.ruby }}
46-
uses: ruby/setup-ruby@v1
47-
with:
48-
ruby-version: ${{ matrix.ruby }}
49-
bundler-cache: true
50-
51-
- name: Install dependencies
52-
run: bundle install
53-
54-
- name: Compile extension
55-
run: bundle exec rake compile
56-
57-
- name: Run tests
58-
run: bundle exec rake test
59-
60-
test-windows:
61-
runs-on: windows-latest
62-
strategy:
63-
fail-fast: false
64-
matrix:
65-
ruby: ['3.1', '3.2', '3.3']
66-
67-
steps:
68-
- uses: actions/checkout@v4
69-
70-
- name: Set up Ruby ${{ matrix.ruby }}
71-
uses: ruby/setup-ruby@v1
72-
with:
73-
ruby-version: ${{ matrix.ruby }}
74-
bundler-cache: true
75-
76-
- name: Install dependencies
77-
run: bundle install
78-
79-
- name: Compile extension
80-
run: bundle exec rake compile
81-
82-
- name: Run tests
83-
run: bundle exec rake test
84-
85-
cmake-build:
10+
test:
11+
name: test (${{ matrix.os }}, ruby ${{ matrix.ruby }}, ${{ matrix.toolchain }})
8612
runs-on: ${{ matrix.os }}
8713
strategy:
8814
fail-fast: false
8915
matrix:
9016
include:
17+
# Linux
9118
- os: ubuntu-latest
19+
ruby: '3.1'
9220
preset: linux-release
21+
toolchain: system
22+
- os: ubuntu-latest
23+
ruby: '3.2'
24+
preset: linux-release
25+
toolchain: system
26+
- os: ubuntu-latest
27+
ruby: '3.3'
28+
preset: linux-release
29+
toolchain: system
30+
- os: ubuntu-latest
31+
ruby: '3.4'
32+
preset: linux-release
33+
toolchain: system
34+
35+
# macOS
9336
- os: macos-latest
37+
ruby: '3.2'
9438
preset: macos-release
95-
- os: windows-latest
96-
preset: msvc-release
39+
toolchain: system
40+
- os: macos-latest
41+
ruby: '3.3'
42+
preset: macos-release
43+
toolchain: system
44+
- os: macos-latest
45+
ruby: '3.4'
46+
preset: macos-release
47+
toolchain: system
48+
49+
# Windows (MinGW)
50+
- os: windows-2025
51+
ruby: '3.2'
52+
preset: mingw-release
53+
toolchain: mingw
54+
- os: windows-2025
55+
ruby: '3.3'
56+
preset: mingw-release
57+
toolchain: mingw
58+
- os: windows-2025
59+
ruby: '3.4'
60+
preset: mingw-release
61+
toolchain: mingw
9762

9863
steps:
9964
- uses: actions/checkout@v4
10065

101-
- name: Set up Ruby
66+
# Ruby
67+
- name: Set up Ruby ${{ matrix.ruby }}
10268
uses: ruby/setup-ruby@v1
10369
with:
104-
ruby-version: '3.2'
105-
106-
- name: Install Rice gem
107-
run: gem install rice
70+
ruby-version: ${{ matrix.ruby }}
71+
bundler-cache: true
10872

109-
- name: Install Ninja (Ubuntu)
73+
# Toolchains / Ninja
74+
- name: Install Ninja (Linux)
11075
if: runner.os == 'Linux'
111-
run: sudo apt-get install -y ninja-build
76+
run: |
77+
sudo apt-get update
78+
sudo apt-get install -y ninja-build
11279
11380
- name: Install Ninja (macOS)
11481
if: runner.os == 'macOS'
11582
run: brew install ninja
11683

117-
- name: Install Ninja (Windows)
118-
if: runner.os == 'Windows'
119-
run: choco install ninja
120-
121-
- name: Setup MSVC (Windows)
84+
- name: Install Ninja (RubyInstaller MSYS2)
12285
if: runner.os == 'Windows'
123-
uses: ilammy/msvc-dev-cmd@v1
124-
125-
- name: Configure CMake
86+
shell: pwsh
87+
run: |
88+
ridk exec pacman -Syu --noconfirm
89+
ridk exec pacman -S --needed --noconfirm `
90+
mingw-w64-ucrt-x86_64-gcc `
91+
mingw-w64-ucrt-x86_64-cmake `
92+
mingw-w64-ucrt-x86_64-ninja
93+
94+
# Configure + Build
95+
- name: Configure CMake (Linux/macOS)
96+
if: runner.os != 'Windows'
97+
working-directory: ext
12698
run: cmake --preset ${{ matrix.preset }}
12799

128-
- name: Build
100+
- name: Build (Linux/macOS)
101+
if: runner.os != 'Windows'
102+
working-directory: ext
129103
run: cmake --build --preset ${{ matrix.preset }}
130104

105+
- name: Configure CMake (Windows MinGW)
106+
if: runner.os == 'Windows' && matrix.toolchain == 'mingw'
107+
working-directory: ext
108+
shell: pwsh
109+
run: ridk exec cmake --preset ${{ matrix.preset }}
110+
111+
- name: Build (Windows MinGW)
112+
if: runner.os == 'Windows' && matrix.toolchain == 'mingw'
113+
working-directory: ext
114+
shell: pwsh
115+
run: ridk exec cmake --build --preset ${{ matrix.preset }}
116+
117+
# Tests
118+
- name: Install dependencies
119+
run: bundle install
120+
121+
- name: Run tests
122+
run: bundle exec rake test
123+
131124
lint:
132125
runs-on: ubuntu-latest
133126
steps:
134127
- uses: actions/checkout@v4
135-
136128
- name: Set up Ruby
137129
uses: ruby/setup-ruby@v1
138130
with:
139131
ruby-version: '3.2'
140-
141132
- name: Check gemspec
142-
run: gem build bitmap_plus_plus.gemspec --strict
133+
run: gem build bitmap-plus-plus.gemspec --strict

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22

33
source "https://rubygems.org"
44

5-
# Specify your gem's dependencies in bitmap_plus_plus.gemspec
65
gemspec

0 commit comments

Comments
 (0)