Skip to content

Commit

Permalink
add gem installation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancyq committed Sep 8, 2024
1 parent 6858066 commit 078fd2a
Showing 1 changed file with 133 additions and 0 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Gem Installation
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
package:
name: "Package for ${{ matrix.platform }}"
strategy:
fail-fast: false
matrix:
platform:
- arm64-darwin
- ruby
- x64-mingw-ucrt
- x64-mingw32
- x86_64-darwin
- x86_64-linux
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

# https://bundler.io/blog/2018/01/17/making-gem-development-a-little-better.html
- name: Remove bundler lockfile
run: rm Gemfile.lock

- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler: latest
bundler-cache: true

- run: "bundle exec rake gem:${{matrix.platform}}"

- uses: actions/upload-artifact@v4
with:
name: gem-${{matrix.platform}}
path: pkg
retention-days: 1

vanilla-install:
needs: [package]
runs-on: ubuntu-latest
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- uses: actions/download-artifact@v4
with:
name: gem-ruby
path: pkg
- run: "gem install pkg/rodiff-*.gem"
- run: "rodiff 2>&1 | fgrep 'ERROR: Cannot find the rodiff executable'"

linux-install:
needs: [package]
runs-on: ubuntu-latest
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- uses: actions/download-artifact@v4
with:
name: gem-x86_64-linux
path: pkg
- run: "gem install pkg/rodiff-*.gem"
- run: "rodiff --help"

darwin-x86_64-install:
needs: [package]
runs-on: macos-13
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- uses: actions/download-artifact@v4
with:
name: gem-x86_64-darwin
path: pkg
- run: "gem install pkg/rodiff-*.gem"
- run: "rodiff --help"

darwin-arm64-install:
needs: [package]
runs-on: macos-14
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- uses: actions/download-artifact@v4
with:
name: gem-arm64-darwin
path: pkg
- run: "gem install pkg/rodiff-*.gem"
- run: "rodiff --help"

windows-install:
needs: [package]
runs-on: windows-latest
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
- uses: actions/download-artifact@v4
with:
name: gem-x64-mingw32
path: pkg
- run: "gem install pkg/rodiff-*.gem"
- run: "rodiff --help"

windows-ucrt-install:
needs: [package]
runs-on: windows-latest
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- uses: actions/download-artifact@v4
with:
name: gem-x64-mingw-ucrt
path: pkg
- run: "gem install pkg/rodiff-*.gem"
- run: "rodiff --help"

0 comments on commit 078fd2a

Please sign in to comment.