This repository has been archived by the owner on Jan 10, 2023. It is now read-only.
forked from asciidoctor/asciidoctor-pdf
-
Notifications
You must be signed in to change notification settings - Fork 1
108 lines (108 loc) · 3.4 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
name: CI
on:
push:
branches: ['**']
tags-ignore: ['**']
pull_request:
schedule:
- cron: '0 2 * * *'
jobs:
activate:
if: "!endsWith(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- name: Proceed
run: echo ok go
lint:
needs: activate
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Configure Bundler
run: |
bundle config --local path .bundle/gems
bundle config --local without coverage docs
- name: Install dependencies
run: bundle --jobs 3 --retry 3
- name: Run linter
run: bundle exec rake lint
build:
needs: lint
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
ruby: [jruby-9.2, '2.5', '2.6', '2.7', '3.0']
upstream: [~]
exclude:
- os: ubuntu-latest
ruby: '3.0'
include:
- os: macos-latest
ruby: '3.0'
- os: ubuntu-latest
ruby: '2.5'
rouge-version: '~> 2.0.0'
- os: ubuntu-latest
ruby: '3.0'
upstream: upstream
- os: ubuntu-latest
ruby: '3.0'
primary: primary
runs-on: ${{ matrix.os }}
env:
MENTOS_TIMEOUT: 30 # give pygments.rb calls more time to execute (in seconds)
PYGMENTS_VERSION: '~> 1.2.0' # test runner will automatically disable Pygments tests on JRuby for Windows
RGHOST_VERSION: '0.9.7'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Reinstall Bundler
if: matrix.os == 'windows-latest' && matrix.ruby == 'jruby-9.2'
run: |
gem uninstall -x bundler
gem install -N bundler -v 2.1.4
- name: Configure Bundler
run: |
bundle config --local path .bundle/gems
bundle config --local without coverage docs lint
- name: Install Ghostscript and Poppler (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install ghostscript poppler-utils
- name: Install Ghostscript and Poppler (macOS)
if: matrix.os == 'macos-latest'
run: brew install ghostscript poppler
- name: Install Ghostscript and Poppler and set GS env var (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install --no-progress ghostscript poppler
echo "GS=$(& where.exe /R 'C:\Program Files\gs' gswin64c.exe)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Set Prawn Gmagick version / Install GraphicsMagick (Linux only)
if: matrix.primary
run: |
echo 'PRAWN_GMAGICK_VERSION=0.0.9' >> $GITHUB_ENV
sudo apt-get install libgraphicsmagick1-dev
- name: Install dependencies
run: bundle --jobs 3 --retry 3
- name: Switch to upstream dependencies
if: matrix.upstream
run: |
bundle exec ruby scripts/switch-to-asciidoctor-master.rb
bundle exec ruby scripts/switch-to-prawn-master.rb
rm -f Gemfile.lock
bundle config --local clean true
bundle --jobs 3 --retry 3
- name: Run tests
run: bundle exec ruby -w $(bundle exec ruby -e 'print File.join Gem.bindir, %q(rake)') spec