Add CI pipeline and some upstream changes #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ '*' ] | |
jobs: | |
test_and_build: | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: | |
- 'ubuntu-latest' | |
- 'macos-13' | |
- 'macos-14' | |
- 'macos-15' | |
include: | |
- os: ubuntu-latest | |
arch: 'x86_64-linux' | |
- os: macos-13 | |
arch: 'arm64-darwin-22' | |
- os: macos-14 | |
arch: 'arm64-darwin-23' | |
- os: macos-15 | |
arch: 'arm64-darwin-24' | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Ruby 3.1 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.1 | |
- name: Print system info | |
run: uname -r | |
- name: Print ruby platform | |
run: ruby -e 'puts RUBY_PLATFORM' | |
- name: Print rubygems env | |
run: gem env | |
- name: Install dev dependencies (Ubuntu) | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get install -y libpng-dev libjpeg-dev libsqlite3-dev | |
- name: Install dev dependencies (macOS) | |
if: startsWith(matrix.os, 'macos-') | |
run: brew install libpng jpeg sqlite3 imagemagick | |
- name: Install dependencies | |
run: bundle install | |
- name: Compile | |
run: bundle exec rake compile | |
- name: Post-Compile (Failure) | |
if: failure() | |
run: cat ext/phashion_ext/mkmf.log | |
- name: Post-Compile (Success) | |
if: success() | |
run: bundle exec rake native gem | |
- name: Run tests | |
run: bundle exec rake | |
- name: Step | |
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.arch }}-${{ env.SHORT_SHA }} | |
overwrite: true | |
path: | | |
pkg/*.gem |