Skip to content

Commit 06f8159

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

File tree

2 files changed

+91
-99
lines changed

2 files changed

+91
-99
lines changed

.github/workflows/ci.yml

Lines changed: 91 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -2,141 +2,134 @@ 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
18+
- os: ubuntu-latest
19+
ruby: '3.1'
20+
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
9130
- os: ubuntu-latest
31+
ruby: '3.4'
9232
preset: linux-release
33+
toolchain: system
34+
35+
# macOS
36+
- os: macos-latest
37+
ruby: '3.2'
38+
preset: macos-release
39+
toolchain: system
9340
- os: macos-latest
41+
ruby: '3.3'
9442
preset: macos-release
95-
- os: windows-latest
96-
preset: msvc-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
84+
# MinGW: MSYS2 with gcc + ninja + cmake
85+
- name: Setup MSYS2 (MinGW)
86+
if: runner.os == 'Windows' && matrix.toolchain == 'mingw'
87+
uses: msys2/setup-msys2@v2
88+
with:
89+
msystem: MINGW64
90+
update: true
91+
install: >-
92+
mingw-w64-x86_64-gcc
93+
mingw-w64-x86_64-cmake
94+
mingw-w64-x86_64-ninja
95+
96+
# Configure + Build
97+
- name: Configure CMake (Linux/macOS)
98+
if: runner.os != 'Windows'
99+
working-directory: ext
100+
run: cmake --preset ${{ matrix.preset }}
120101

121-
- name: Setup MSVC (Windows)
122-
if: runner.os == 'Windows'
123-
uses: ilammy/msvc-dev-cmd@v1
102+
- name: Build (Linux/macOS)
103+
if: runner.os != 'Windows'
104+
working-directory: ext
105+
run: cmake --build --preset ${{ matrix.preset }}
124106

125-
- name: Configure CMake
107+
- name: Configure CMake (Windows MinGW)
108+
if: runner.os == 'Windows' && matrix.toolchain == 'mingw'
109+
working-directory: ext
110+
shell: msys2 {0}
126111
run: cmake --preset ${{ matrix.preset }}
127112

128-
- name: Build
113+
- name: Build (Windows MinGW)
114+
if: runner.os == 'Windows' && matrix.toolchain == 'mingw'
115+
working-directory: ext
116+
shell: msys2 {0}
129117
run: cmake --build --preset ${{ matrix.preset }}
130118

119+
# Tests
120+
- name: Install dependencies
121+
run: bundle install
122+
123+
- name: Run tests
124+
run: bundle exec rake test
125+
131126
lint:
132127
runs-on: ubuntu-latest
133128
steps:
134129
- uses: actions/checkout@v4
135-
136130
- name: Set up Ruby
137131
uses: ruby/setup-ruby@v1
138132
with:
139133
ruby-version: '3.2'
140-
141134
- name: Check gemspec
142-
run: gem build bitmap_plus_plus.gemspec --strict
135+
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)