-
Notifications
You must be signed in to change notification settings - Fork 140
152 lines (142 loc) · 5 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
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 3.3
uses: ruby/setup-ruby@master
with:
ruby-version: '3.3'
bundler-cache: true
- name: Build and test with Rake
run: |
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'
bundler-cache: true
- name: Validate RBS signatures
run: |
bundle exec rake rbs:validate && bundle exec steep check
test-linux:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4.0-preview1']
imagemagick-version:
- { full: 6.8.9-10, major-minor: '6.8' }
- { full: 6.9.13-11, major-minor: '6.9' }
- { full: 7.0.11-14, major-minor: '7.0' }
- { full: 7.1.1-33, major-minor: '7.1' }
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: Update/Install packages
run: |
export IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }}
./before_install_linux.sh
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@master
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Build and test with Rake
run: |
bundle exec rake
test-macos:
runs-on: macos-latest
timeout-minutes: 20
strategy:
matrix:
ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4.0-preview1']
imagemagick-version:
- { full: 6.9.13-11, major-minor: '6.9' }
- { full: 7.1.1-33, 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: Update/Install packages
run: |
IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }} ./before_install_osx.sh
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@master
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Build and test with Rake
run: |
bundle exec rake
test-windows:
runs-on: windows-latest
timeout-minutes: 20
strategy:
matrix:
ruby-version: ['3.3']
imagemagick-version:
- { full: 6.9.13-11, major-minor: '6.9' }
- { full: 7.1.1-33, 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: 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: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@master
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Build and test with Rake
run: |
cmd.exe /D /S /C "bundle exec rake"