Skip to content

Commit

Permalink
Add FreeBSD to CI matrix
Browse files Browse the repository at this point in the history
To ensure we cover as many platforms as possible, add a dedicated
FreeBSD job to CI.

We also ensure we test the non-precompiled gem with both system and
vendored libraries where possible and bump the default version of Ruby
to 3.3.
  • Loading branch information
mudge committed Apr 7, 2024
1 parent 1434ae7 commit 515d55a
Showing 1 changed file with 43 additions and 42 deletions.
85 changes: 43 additions & 42 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ env:

jobs:
build-cruby-gem:
name: "Build CRuby gem"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
Expand All @@ -26,16 +25,15 @@ jobs:
key: archives-ubuntu-${{hashFiles('ext/re2/extconf.rb')}}
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "3.3"
bundler-cache: true
- run: ./scripts/test-gem-build gems ruby ${{github.ref_type}}
- run: ./scripts/test-gem-build gems ruby
- uses: actions/upload-artifact@v4
with:
name: cruby-gem
path: gems

build-precompiled-gems:
name: "Precompile ${{ matrix.platform }} gem"
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -65,19 +63,12 @@ jobs:
name: "cruby-${{matrix.platform}}-gem"
path: gems

compile-and-test-system-dependencies:
name: System libre2.${{ matrix.libre2.soname }} - Ruby ${{ matrix.ruby }}
compile-and-test-system-re2-versions:
needs: ["build-cruby-gem"]
runs-on: ubuntu-20.04
strategy:
matrix:
ruby:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
- '2.7'
- '2.6'
ruby: ["3.3", "2.6"] # oldest and newest"
libre2:
- version: "20150501"
soname: 0
Expand Down Expand Up @@ -121,58 +112,56 @@ jobs:
- run: ./scripts/test-gem-install gems --enable-system-libraries

compile-and-test-vendored-dependencies:
name: Vendored - Ruby ${{ matrix.ruby }} - ${{ matrix.runs-on }}
needs: ["build-cruby-gem"]
strategy:
fail-fast: false
matrix:
runs-on: ["ubuntu-latest", "macos-latest"]
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
sys: ["enable", "disable"]
include:
- ruby: "2.6"
runs-on: "windows-2019"
requires-pkgconf-pin: true
pin-pkgconf: true # can be removed once pkgconf 2.2.0 is available
- ruby: "2.7"
runs-on: "windows-2019"
requires-pkgconf-pin: true
pin-pkgconf: true
- ruby: "3.0"
runs-on: "windows-2019"
requires-pkgconf-pin: true
pin-pkgconf: true
- ruby: "3.1"
runs-on: "windows-2022"
requires-pkgconf-pin: true
pin-pkgconf: true
- ruby: "3.2"
runs-on: "windows-2022"
requires-pkgconf-pin: true
pin-pkgconf: true
- ruby: "3.3"
runs-on: "windows-2022"
requires-pkgconf-pin: true
pin-pkgconf: true
runs-on: ${{matrix.runs-on}}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{matrix.ruby}}
ruby-version: ${{ matrix.ruby }}
apt-get: libre2-dev
brew: re2
mingw: re2
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: gems
- name: Show what version of pkgconf is installed
run: pacman -Qs pkgconf
if: matrix.requires-pkgconf-pin
- name: Download pkgconf 2.1.0
run: curl --remote-name-all https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst https://repo.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst
if: matrix.requires-pkgconf-pin
- name: Install pkgconf 2.1.0
run: pacman -U --noconfirm mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst mingw-w64-ucrt-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst
run: |
pacman -Qs pkgconf
curl --remote-name-all https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst https://repo.msys2.org/mingw/ucrt64/mingw-w64-ucrt-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst mingw-w64-ucrt-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst
pkg-config --version
if: matrix.requires-pkgconf-pin
- name: Show pkg-config version
run: pkg-config --version
- run: ./scripts/test-gem-install gems
- run: ./scripts/test-gem-install gems --${{ matrix.sys }}-system-libraries
shell: bash

compile-and-test-vendored-dependencies-with-system-install:
name: Vendored - system libre2-dev - Ruby 3.2
needs: ["build-cruby-gem"]
runs-on: ubuntu-latest
steps:
Expand All @@ -182,7 +171,7 @@ jobs:
- uses: ruby/setup-ruby@v1
id: setup-ruby
with:
ruby-version: "3.2"
ruby-version: "3.3"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
Expand All @@ -192,8 +181,27 @@ jobs:
run: ln -s /usr/lib/x86_64-linux-gnu/libre2.so ${{ steps.setup-ruby.outputs.ruby-prefix }}/lib/libre2.so
- run: ./scripts/test-gem-install gems

compile-and-test-on-freebsd:
needs: ["build-cruby-gem"]
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: gems
- uses: vmactions/freebsd-vm@v1
with:
usesh: true
copyback: false
prepare: pkg install -y ruby devel/ruby-gems sysutils/rubygem-bundler pkgconf bash devel/re2
run: ./scripts/test-gem-install gems --${{ matrix.sys }}-system-libraries

test-precompiled-aarch64-linux:
name: Precompiled - Ruby ${{ matrix.ruby }} - aarch64-linux
needs: ["build-precompiled-gems"]
strategy:
fail-fast: false
Expand All @@ -215,7 +223,6 @@ jobs:
./scripts/test-gem-install ./gems
test-precompiled-arm-linux:
name: Precompiled - Ruby ${{ matrix.ruby }} - arm-linux
needs: ["build-precompiled-gems"]
strategy:
fail-fast: false
Expand All @@ -237,7 +244,6 @@ jobs:
./scripts/test-gem-install ./gems
test-precompiled-x64-mingw-ucrt:
name: Precompiled - Ruby ${{ matrix.ruby }} - x64-mingw-ucrt
needs: ["build-precompiled-gems"]
strategy:
fail-fast: false
Expand All @@ -257,7 +263,6 @@ jobs:
shell: bash

test-precompiled-x64-mingw32:
name: Precompiled - Ruby ${{ matrix.ruby }} - x64-mingw32
needs: ["build-precompiled-gems"]
strategy:
fail-fast: false
Expand All @@ -277,7 +282,6 @@ jobs:
shell: bash

test-precompiled-x86-linux:
name: Precompiled - Ruby ${{ matrix.ruby }} - x86-linux
needs: ["build-precompiled-gems"]
strategy:
fail-fast: false
Expand All @@ -299,7 +303,6 @@ jobs:
./scripts/test-gem-install ./gems
test-precompiled-x86_64-linux:
name: Precompiled - Ruby ${{ matrix.ruby }} - x86_64-linux
needs: ["build-precompiled-gems"]
strategy:
fail-fast: false
Expand All @@ -318,7 +321,6 @@ jobs:
- run: ./scripts/test-gem-install gems

test-precompiled-x86_64-darwin:
name: Precompiled - Ruby ${{ matrix.ruby }} - x86_64-darwin
needs: ["build-precompiled-gems"]
strategy:
fail-fast: false
Expand All @@ -337,7 +339,6 @@ jobs:
- run: ./scripts/test-gem-install gems

test-precompiled-x86_64-alpine:
name: Precompiled - Ruby ${{ matrix.ruby }} - x86_64-alpine
needs: ["build-precompiled-gems"]
strategy:
fail-fast: false
Expand Down

0 comments on commit 515d55a

Please sign in to comment.