name: CI on: push: branches: - main pull_request: workflow_dispatch: permissions: contents: read jobs: lint: runs-on: ubuntu-latest timeout-minutes: 20 steps: - uses: actions/checkout@v4 - name: Set up Ruby 2.3 uses: ruby/setup-ruby@master with: ruby-version: '2.3' - name: Build and test with Rake run: | bundle install --path=vendor/bundle --jobs 4 --retry 3 STYLE_CHECKS=true bundle exec rubocop rbs: runs-on: ubuntu-latest name: RBS timeout-minutes: 20 steps: - uses: actions/checkout@v4 - name: Set up Ruby 3.0 uses: ruby/setup-ruby@master with: ruby-version: '3.0' - name: Validate RBS signatures run: | bundle install --path=vendor/bundle --jobs 4 --retry 3 bundle exec rake rbs:validate && bundle exec steep check test-linux: runs-on: ubuntu-latest timeout-minutes: 20 strategy: matrix: ruby-version: ['2.3', '2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3'] imagemagick-version: - { full: 6.7.7-10, major-minor: '6.7' } - { full: 6.8.9-10, major-minor: '6.8' } - { full: 6.9.13-4, major-minor: '6.9' } - { full: 7.0.11-14, major-minor: '7.0' } - { full: 7.1.1-26, major-minor: '7.1' } exclude: # Ghostscript 9.55.0 causes error with Ruby 3.3 + ImageMagick 6.7 when run Magick::Draw tests. # It disable running tests with Ruby 3.3 + ImageMagick 6.7 because it might be difficult to support old ImageMagick. - ruby-version: '3.3' imagemagick-version: { major-minor: '6.7' } name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }} steps: - uses: actions/checkout@v4 - name: Cache ImageMagick built objects uses: actions/cache@v4 with: path: ./build-ImageMagick key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }} restore-keys: | v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }} - name: Set up Ruby ${{ matrix.ruby-version }} uses: ruby/setup-ruby@master with: ruby-version: ${{ matrix.ruby-version }} - name: Update/Install packages run: | export IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }} ./before_install_linux.sh - name: Build and test with Rake run: | bundle install --path=vendor/bundle --jobs 4 --retry 3 bundle exec rake test-macos: runs-on: macos-latest timeout-minutes: 20 strategy: matrix: ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3'] imagemagick-version: - { full: 6.9.13-4, major-minor: '6.9' } - { full: 7.1.1-26, major-minor: '7.1' } name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }} steps: - uses: actions/checkout@v4 - name: Cache ImageMagick built objects uses: actions/cache@v4 with: path: ./build-ImageMagick key: v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }} restore-keys: | v1-${{ runner.os }}-imagemagick-${{ matrix.imagemagick-version.full }} - name: Set up Ruby ${{ matrix.ruby-version }} uses: ruby/setup-ruby@master with: ruby-version: ${{ matrix.ruby-version }} - name: Update/Install packages run: | IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }} ./before_install_osx.sh - name: Build and test with Rake run: | bundle install --path=vendor/bundle --jobs 4 --retry 3 bundle exec rake test-windows: runs-on: windows-latest timeout-minutes: 20 strategy: matrix: ruby-version: ['3.3'] imagemagick-version: - { full: 6.9.13-4, major-minor: '6.9' } - { full: 7.1.1-26, major-minor: '7.1' } env: bundled_im_dir: C:\Program Files\ImageMagick-7.1.1-Q16-HDRI install_im_dir: D:\ImageMagick name: MSWin, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }} steps: - uses: actions/checkout@v4 - name: Setup environment variable # https://stackoverflow.com/questions/60169752/how-to-update-the-path-in-a-github-action-workflow-file-for-a-windows-latest-hos run: | Add-Content $env:GITHUB_PATH ${{ env.install_im_dir }} - name: Uninstall bundled ImageMagick # Bundled ImageMagick does not have C/C++ library and dll which required by rmagick. run: | Start-Process -FilePath "${{ env.bundled_im_dir }}\unins000.exe" -ArgumentList "/VERYSILENT /NORESTART" - name: Set up Ruby ${{ matrix.ruby-version }} uses: ruby/setup-ruby@master with: ruby-version: ${{ matrix.ruby-version }} - name: Install ghostscript run: | choco install ghostscript - name: Install ImageMagick # https://github.com/rmagick/ImageMagick-binaries run: | $imagemagick_version = "${{ matrix.imagemagick-version.full }}" $installer_name = "ImageMagick-$($imagemagick_version)-Q16-x64-dll.exe" $url = "https://github.com/rmagick/ImageMagick-binaries/raw/main/$($installer_name)" Invoke-WebRequest -Uri $url -OutFile $installer_name Start-Process -FilePath $installer_name -ArgumentList "/DIR=${{ env.install_im_dir }} /VERYSILENT /NORESTART /TASKS=install_Devel" - name: Build and test with Rake run: | cmd.exe /D /S /C "bundle install --path=vendor/bundle --retry 3 & bundle exec rake"