CI: Update versions in test matrix #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
- push | |
- pull_request | |
jobs: | |
test: | |
name: Test with Asciidoctor ${{ matrix.asciidoctor }} on Ruby ${{ matrix.ruby }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby: | |
- head | |
- jruby-head | |
- '3.3' | |
- '3.2' | |
- '3.1' | |
- '2.7' | |
asciidoctor: [2.0.22] | |
include: | |
- { asciidoctor: 'git:main', ruby: 3.3 } | |
- { asciidoctor: 2.0.20 , ruby: 3.2 } | |
- { asciidoctor: 2.0.16 , ruby: 3.0 } | |
- { asciidoctor: 2.0.10 , ruby: 2.7 } | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
ASCIIDOCTOR_VERSION: ${{ matrix.asciidoctor }} | |
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.asciidoctor == 'git:main' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: sudo apt-get install pandoc | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- run: bundle exec rake spec | |
- run: bundle exec rake rubocop | |
# FIXME: upgrade rubocop | |
if: startsWith(matrix.ruby, '2.') | |
- run: bundle exec rake build:js | |
# FIXME: update Opal | |
if: matrix.ruby < 3.2 && endsWith(matrix.ruby, 'head') == false | |
- run: bundle exec rake readme2md | |
publish: | |
name: Publish to RubyGems and npmjs | |
needs: [test] | |
if: startsWith(github.ref, 'refs/tags/v') && github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: sudo apt-get install pandoc | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2 | |
bundler-cache: true | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org | |
- run: bundle exec rake build:js | |
- run: bundle exec rake readme2md | |
- name: Publish to RubyGems | |
run: | | |
install -D -m 0600 /dev/null $HOME/.gem/credentials | |
printf -- '---\n:rubygems_api_key: %s\n' "$RUBYGEMS_API_KEY" > $HOME/.gem/credentials | |
gem build *.gemspec | |
gem push *.gem | |
env: | |
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | |
- name: Publish to npmjs | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |