name: CI on: push: branches: ['**'] tags-ignore: ['**'] pull_request: schedule: - cron: '0 2 * * *' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: activate: if: | (github.event_name == 'schedule' && github.repository_owner == 'asciidoctor') || (github.event_name == 'push') || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'docs/')) 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.1' - 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.3, '2.7', '3.1'] rouge-version: [~] upstream: [~] exclude: # remove 3.1 on ubuntu-latest to mark as primary - os: ubuntu-latest ruby: '3.1' include: - os: ubuntu-latest ruby: jruby-9.2 - os: ubuntu-latest ruby: '3.0' - os: macos-latest ruby: '3.1' # NOTE: enable once Asciidoctor 2.1.0 is released #- os: ubuntu-latest # ruby: '2.7' # asciidoctor-version: '~> 2.0.0' - os: ubuntu-latest ruby: '2.7' rouge-version: '~> 2.0.0' - os: ubuntu-latest ruby: '3.1' upstream: upstream - os: ubuntu-latest ruby: '3.1' primary: primary runs-on: ${{ matrix.os }} env: ASCIIDOCTOR_DIAGRAM_VERSION: '~> 2.2' PYGMENTS_VERSION: '~> 2.0' RGHOST_VERSION: '0.9.7' # work around `Permission denied - NUL' error when installing/using the bundler gem on JRuby for Windows JRUBY_OPTS: '-J-Djdk.io.File.enableADS=true' 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: Configure Bundler run: | bundle config --local path .bundle/gems bundle config --local without coverage docs lint - name: Enable coverage if: matrix.primary run: | bundle config unset --local without bundle config --local without docs lint echo 'COVERAGE=deep' >> $GITHUB_ENV - 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: Set Rouge version if: matrix.rouge-version run: echo 'ROUGE_VERSION=${{ matrix.rouge-version }}' >> $GITHUB_ENV - 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-head.rb bundle exec ruby scripts/switch-to-prawn-head.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