diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/ci.yml | 72 | ||||
| -rw-r--r-- | .github/workflows/release.yml | 36 |
2 files changed, 108 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..66c0e016 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: CI +on: [push, pull_request] +jobs: + activate: + runs-on: ubuntu-latest + if: | + !endsWith(github.event.head_commit.message, '[skip ci]') + steps: + - run: echo ok go + build: + needs: activate + strategy: + matrix: + os: [ubuntu-latest] + ruby: [truffleruby-20.2.0, 2.3.8, 2.4.10, 2.5.8, 2.6.6, jruby-9.1.17.0] + rouge-version: [~] + include: + - os: ubuntu-latest + ruby: jruby-9.2.13.0 + jruby-opts: '-J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Xss2m -Xcompile.invokedynamic=false' + - os: ubuntu-latest + ruby: 2.3.8 + rouge-version: '~> 2.0.0' + - os: ubuntu-latest + ruby: 2.7.2 + primary: true + runs-on: ${{ matrix.os }} + env: + COVERAGE: ${{ matrix.primary }} + PYGMENTS_VERSION: '~> 1.2.0' + SOURCE_DATE_EPOCH: '1521504000' + 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 docs + - name: Set Rouge version + if: matrix.rouge-version + run: | + echo "ROUGE_VERSION=${{ matrix.rouge-version }}" >> $GITHUB_ENV + - name: Set JRUBY_OPTS + if: matrix.jruby-opts + run: | + echo "JRUBY_OPTS=${{ matrix.jruby-opts }}" >> $GITHUB_ENV + - name: Install Nokogiri build dependencies + if: contains(matrix.ruby, 'truffleruby') + run: | + sudo apt-get install libxslt1-dev + - name: Install dependencies + run: | + bundle --jobs 3 --retry 3 + - name: Run tests + run: | + bundle exec ruby -w $(bundle exec ruby -e 'print File.join Gem.bindir, %q(rake)') test:all + - name: Build dependents + if: | + matrix.primary && + github.repository == 'asciidoctor/asciidoctor' && + !github.base_ref + env: + GITHUB_API_TOKEN: ${{ secrets._GITHUB_API_TOKEN }} + TRAVIS_API_TOKEN: ${{ secrets.TRAVIS_API_TOKEN }} + run: | + bundle exec rake build:dependents diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..9136b011 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release +on: + push: + tags: + - 'v*' +jobs: + activate: + runs-on: ubuntu-latest + if: | + github.repository == 'asciidoctor/asciidoctor' + steps: + - run: echo ok go + build: + needs: activate + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.2 + - 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 tests + run: | + bundle exec rake test:all + - name: Publish gem + uses: dawidd6/action-publish-gem@v1 + with: + api_key: ${{ secrets.RUBYGEMS_API_KEY }} |
