Skip to content

Commit

Permalink
Initial commit of rb-mrml
Browse files Browse the repository at this point in the history
  • Loading branch information
mudge committed Jan 13, 2025
0 parents commit 8081038
Show file tree
Hide file tree
Showing 18 changed files with 1,170 additions and 0 deletions.
322 changes: 322 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,322 @@
name: Tests

concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
schedule:
- cron: "30 4 * * 4"

jobs:
ruby-gem:
name: Package Ruby gem
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: bundle exec rake build
- uses: actions/upload-artifact@v4
with:
name: ruby-gem
path: pkg/*.gem

test-ruby-gem:
needs: ruby-gem
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.4'
- '3.3'
- '3.2'
- '3.1'
- '3.0'
- '2.7'
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/download-artifact@v4
with:
name: ruby-gem
path: pkg
- run: scripts/test-gem-install default

cross-gem:
name: Compile native gem for ${{ matrix.platform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- arm-linux
- aarch64-linux
- aarch64-linux-musl
- arm64-darwin
- x64-mingw-ucrt
- x64-mingw32
- x86_64-darwin
- x86_64-linux
- x86_64-linux-musl
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- uses: oxidize-rb/actions/cross-gem@v1
id: cross-gem
with:
platform: ${{ matrix.platform }}
ruby-versions: '2.7,3.0,3.1,3.2,3.3,3.4'
- uses: actions/upload-artifact@v4
with:
name: cross-gem-${{ matrix.platform }}
path: ${{ steps.cross-gem.outputs.gem-path }}

test-precompiled-arm-linux:
needs: "cross-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
include:
- { ruby: "2.7", rubygems: "3.4.22" }
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4", rubygems: "default" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cross-gem-arm-linux
path: pkg
- name: enable execution of multi-architecture containers by qemu
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- run: |
docker run --rm -v "$(pwd):/rb-mrml" -w /rb-mrml \
--platform=linux/arm/v7 \
ruby:${{ matrix.ruby }} \
./scripts/test-gem-install ${{ matrix.rubygems }}
test-precompiled-aarch64-linux:
needs: "cross-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
include:
- { ruby: "2.7", rubygems: "3.4.22" }
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4", rubygems: "default" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cross-gem-aarch64-linux
path: pkg
- name: enable execution of multi-architecture containers by qemu
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- run: |
docker run --rm -v "$(pwd):/rb-mrml" -w /rb-mrml \
--platform=linux/arm64 \
ruby:${{ matrix.ruby }} \
./scripts/test-gem-install ${{ matrix.rubygems }}
test-precompiled-aarch64-linux-musl:
needs: "cross-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
include:
- { ruby: "2.7", rubygems: "3.4.22" }
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4", rubygems: "default" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cross-gem-aarch64-linux-musl
path: pkg
- name: enable execution of multi-architecture containers by qemu
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- run: |
docker run --rm -v "$(pwd):/rb-mrml" -w /rb-mrml \
--platform=linux/arm64 \
ruby:${{ matrix.ruby }}-alpine \
./scripts/test-gem-install ${{ matrix.rubygems }}
test-precompiled-arm64-darwin:
needs: "cross-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
include:
- { ruby: "2.7", rubygems: "3.4.22" }
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4", rubygems: "default" }
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cross-gem-arm64-darwin
path: pkg
- run: ./scripts/test-gem-install default

test-precompiled-x64-mingw-ucrt:
needs: "cross-gem"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "3.4"]
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: MSP-Greg/setup-ruby-pkgs@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cross-gem-x64-mingw-ucrt
path: pkg
- run: ./scripts/test-gem-install default
shell: bash

test-precompiled-x64-mingw32:
needs: "cross-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0"]
include:
- { ruby: "2.7", rubygems: "3.4.22" }
- { ruby: "3.0", rubygems: "3.5.23" }
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cross-gem-x64-mingw32
path: pkg
- run: ./scripts/test-gem-install default
shell: bash

test-precompiled-x86_64-darwin:
needs: "cross-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
include:
- { ruby: "2.7", rubygems: "3.4.22" }
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4", rubygems: "default" }
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cross-gem-x86_64-darwin
path: pkg
- run: ./scripts/test-gem-install default

test-precompiled-x86_64-linux:
needs: "cross-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
include:
- { ruby: "2.7", rubygems: "3.4.22" }
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4", rubygems: "default" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
rubygems: "${{ matrix.rubygems }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cross-gem-x86_64-linux
path: pkg
- run: ./scripts/test-gem-install default

test-precompiled-x86_64-linux-musl:
needs: "cross-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
include:
- { ruby: "2.7", rubygems: "3.4.22" }
- { ruby: "3.0", rubygems: "3.5.23" }
- { ruby: "3.1", rubygems: "default" }
- { ruby: "3.2", rubygems: "default" }
- { ruby: "3.3", rubygems: "default" }
- { ruby: "3.4", rubygems: "default" }
runs-on: ubuntu-latest
container:
image: "ruby:${{ matrix.ruby }}-alpine"
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cross-gem-x86_64-linux-musl
path: pkg
- run: ./scripts/test-gem-install ${{ matrix.rubygems }}
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/Gemfile.lock
/.bundle/
/.yardoc
/_yardoc/
/coverage/
/doc/
/pkg/
/tmp/
*.bundle
*.so
*.o
*.a
mkmf.log
target/
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] - 2025-01-11

### Added

- The initial version of the mrml-ruby gem, providing Ruby bindings to the
reimplementation of the MJML markup language in Rust.
Loading

0 comments on commit 8081038

Please sign in to comment.