summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml51
-rw-r--r--.github/workflows/release.yml19
2 files changed, 70 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..58d832d
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,51 @@
+name: CI
+on: [push, pull_request]
+jobs:
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Set up Ruby
+ uses: eregon/use-ruby-action@master
+ with:
+ ruby-version: 2.7
+ - name: Build
+ run: |
+ gem install bundler
+ bundle install --jobs 4 --retry 3
+ - name: Lint
+ run: bundle exec rake lint
+ test:
+ strategy:
+ matrix:
+ ruby: [2.3, 2.4, 2.5, 2.6, 2.7, jruby]
+ platform: [ubuntu-latest, macos-latest, windows-latest]
+ asciidoctor: [1.5.3, '']
+ exclude:
+ # kindlegen fails to install on 2.3 on Windows. See https://github.com/asciidoctor/asciidoctor-epub3/pull/213
+ - ruby: 2.3
+ platform: windows-latest
+ # TODO: nokogiri doesn't install on 2.7 on Windows: https://github.com/sparklemotion/nokogiri/issues/1961
+ - ruby: 2.7
+ platform: windows-latest
+ # eregon/use-ruby-action doesn't support JRUBY on Windows
+ - ruby: jruby
+ platform: windows-latest
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Set up Ruby
+ uses: eregon/use-ruby-action@master
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ - name: Set up Asciidoctor
+ if: matrix.asciidoctor != ''
+ run: echo "::set-env name=ASCIIDOCTOR_VERSION::${{ matrix.asciidoctor }}"
+ - name: Build
+ run: |
+ gem install bundler
+ bundle install --jobs 4 --retry 3
+ - name: Test
+ run: bundle exec ruby -w $(bundle exec ruby -e "print Gem.bin_path 'rake', 'rake'") spec
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..23dfdad
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,19 @@
+name: Publish to RubyGems.org
+on:
+ push:
+ tags:
+ - '*'
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Ruby
+ uses: eregon/use-ruby-action@master
+ with:
+ ruby-version: 2.7
+ - name: Publish to RubyGems.org
+ uses: cadwallion/publish-rubygems-action@master
+ env:
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+ RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}