diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2020-11-09 13:57:13 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-09 13:57:13 -0700 |
| commit | 092b91656bed3b388fefc6ec2edebb1e13dd3fbe (patch) | |
| tree | 118fdc9d84db8a64292cf1f420ca2a19bc78b723 | |
| parent | 1b3fc6c834b249898b28419bb989c96db64b7bc8 (diff) | |
resolves #3837 migrate Linux-based CI jobs to GitHub Actions (PR #3838)
| -rw-r--r-- | .github/workflows/ci.yml | 72 | ||||
| -rw-r--r-- | .github/workflows/release.yml | 36 | ||||
| -rw-r--r-- | .travis.yml | 49 | ||||
| -rw-r--r-- | CHANGELOG.adoc | 4 | ||||
| -rw-r--r-- | README-de.adoc | 10 | ||||
| -rw-r--r-- | README-fr.adoc | 10 | ||||
| -rw-r--r-- | README-jp.adoc | 12 | ||||
| -rw-r--r-- | README-zh_CN.adoc | 10 | ||||
| -rw-r--r-- | README.adoc | 2 | ||||
| -rw-r--r-- | tasks/dependents.rake | 16 |
10 files changed, 120 insertions, 101 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 }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f1def2d2..00000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -os: linux -dist: bionic -git: - depth: 5 # use depth 5 to leave enough room for concurrent builds -language: ruby -env: - global: - # use system libraries to speed up installation of nokogiri - - NOKOGIRI_USE_SYSTEM_LIBRARIES=true - - PYGMENTS_VERSION='~> 1.2.0' - - SOURCE_DATE_EPOCH=1521504000 -stages: -- test -- name: release - if: repo = asciidoctor/asciidoctor AND tag IS present -install: -- bundle config --local path .bundle/gems -- bundle config --local without coverage docs -- bundle --jobs 3 --retry 3 -script: bundle exec ruby -w $(bundle exec which rake) test:all -# always specify exact Ruby versions so we can control which version we're actually testing -jobs: - include: - - stage: test - rvm: jruby-9.2.13.0 - env: JRUBY_OPTS='-J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Xss2m -Xcompile.invokedynamic=false' - - rvm: jruby-9.1.17.0 - dist: trusty - - rvm: truffleruby-20.2.0 - # run against TruffleRuby nightly or if TruffleRuby (case insensitive) is mentioned in commit message - if: type = cron OR commit_message =~ /(?i)truffleruby/ - - rvm: &default_ruby 2.7.2 - script: bundle exec ruby -w $(bundle exec which rake) coverage test:all - after_success: bundle exec rake build:dependents - - rvm: 2.6.6 - - rvm: 2.5.8 - - rvm: 2.4.10 - - rvm: &oldest_ruby 2.3.8 - - rvm: *oldest_ruby - env: ROUGE_VERSION='~> 2.0.0' - - stage: release - rvm: *default_ruby - script: skip - deploy: - provider: rubygems - gem: asciidoctor - api_key: ${RUBYGEMS_API_KEY} - on: - tags: true diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 32b0457b..aadb229a 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -30,6 +30,10 @@ Compliance:: * Defer use of Ruby >= 2.3 constructs to restore compatibility with Ruby 2.0 until at least next minor release (#3827) * Don't append the default px unit identifier to the explicit width or height value when inlining an SVG (#3829) +Build / Infrastructure:: + + * Migrate Linux-based CI jobs to GitHub Actions (#3837) + // tag::compact[] == 2.0.11 (2020-11-02) - @mojavelinux diff --git a/README-de.adoc b/README-de.adoc index 8a9f0a48..bd4bd240 100644 --- a/README-de.adoc +++ b/README-de.adoc @@ -7,7 +7,6 @@ Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://g :language: {source-language} ifndef::env-github[:icons: font] ifdef::env-github[] -:status: :outfilesuffix: .adoc :caution-caption: :fire: :important-caption: :exclamation: @@ -83,15 +82,6 @@ endif::[] * {uri-docs}/user-manual[Asciidoctor Gebrauchshandbuch] * {uri-docs}/asciidoc-syntax-quick-reference[AsciiDoc Syntax-Referenz] -ifdef::status[] -.*Projekt Status* -image:https://img.shields.io/travis/asciidoctor/asciidoctor/master.svg[Build Status (Travis CI), link=https://travis-ci.org/asciidoctor/asciidoctor] -image:https://ci.appveyor.com/api/projects/status/ifplu67oxvgn6ceq/branch/master?svg=true&passingText=green%20bar&failingText=%23fail&pendingText=building%2E%2E%2E[Build Status (AppVeyor), link=https://ci.appveyor.com/project/asciidoctor/asciidoctor] -//image:https://img.shields.io/coveralls/asciidoctor/asciidoctor/master.svg[Coverage Status, link=https://coveralls.io/r/asciidoctor/asciidoctor] -//image:https://codeclimate.com/github/asciidoctor/asciidoctor/badges/gpa.svg[Code Climate, link="https://codeclimate.com/github/asciidoctor/asciidoctor"] -image:https://inch-ci.org/github/asciidoctor/asciidoctor.svg?branch=master[Inline docs, link="https://inch-ci.org/github/asciidoctor/asciidoctor"] -endif::[] - == Sponsoren Wir möchten unseren großzügigen Sponsoren danken, ohne deren Unterstützung Asciidoctor nicht möglich wäre. diff --git a/README-fr.adoc b/README-fr.adoc index e72e154d..dba9c846 100644 --- a/README-fr.adoc +++ b/README-fr.adoc @@ -7,7 +7,6 @@ Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://g :language: {source-language} ifndef::env-github[:icons: font] ifdef::env-github[] -:status: :outfilesuffix: .adoc :caution-caption: :fire: :important-caption: :exclamation: @@ -80,15 +79,6 @@ endif::[] * {uri-docs}/asciidoc-syntax-quick-reference[Syntaxe de Référence AsciiDoc] * {uri-docs}/user-manual[Manuel Utilisateur Asciidoctor] -ifdef::status[] -.*Santé du projet* -image:https://img.shields.io/travis/asciidoctor/asciidoctor/master.svg[Build Status (Travis CI), link=https://travis-ci.org/asciidoctor/asciidoctor] -image:https://ci.appveyor.com/api/projects/status/ifplu67oxvgn6ceq/branch/master?svg=true&passingText=green%20bar&failingText=%23fail&pendingText=building%2E%2E%2E[Build Status (AppVeyor), link=https://ci.appveyor.com/project/asciidoctor/asciidoctor] -//image:https://img.shields.io/coveralls/asciidoctor/asciidoctor/master.svg[Coverage Status, link=https://coveralls.io/r/asciidoctor/asciidoctor] -//image:https://codeclimate.com/github/asciidoctor/asciidoctor/badges/gpa.svg[Code Climate, link="https://codeclimate.com/github/asciidoctor/asciidoctor"] -image:https://inch-ci.org/github/asciidoctor/asciidoctor.svg?branch=master[Inline docs, link="https://inch-ci.org/github/asciidoctor/asciidoctor"] -endif::[] - == Sponsors Nous souhaitons exprimer toute notre reconnaissance à nos généreux sponsors, sans qui Asciidoctor ne pourrait pas exister. diff --git a/README-jp.adoc b/README-jp.adoc index 44b0ad0e..4d3c7401 100644 --- a/README-jp.adoc +++ b/README-jp.adoc @@ -7,7 +7,6 @@ Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://g :language: {source-language} ifndef::env-github[:icons: font] ifdef::env-github[] -:status: :outfilesuffix: .adoc :caution-caption: :fire: :important-caption: :exclamation: @@ -89,17 +88,6 @@ endif::[] * {uri-docs}/user-manual[Asciidoctor User Manual] * {uri-docs}/asciidoc-syntax-quick-reference[AsciiDoc Syntax Reference] -ifdef::status[] -//.*Project health* -image:https://img.shields.io/gem/v/asciidoctor.svg[Latest Release, link={uri-gem}] -image:https://img.shields.io/badge/rubydoc.info-{release-version}-blue.svg[library (API) docs,link=https://www.rubydoc.info/gems/asciidoctor/{release-version}] -image:https://img.shields.io/travis/asciidoctor/asciidoctor/master.svg[Build Status (Travis CI),link=https://travis-ci.org/asciidoctor/asciidoctor] -image:https://ci.appveyor.com/api/projects/status/ifplu67oxvgn6ceq/branch/master?svg=true&passingText=green%20bar&failingText=%23fail&pendingText=building%2E%2E%2E[Build Status (AppVeyor),link=https://ci.appveyor.com/project/asciidoctor/asciidoctor] -//image:https://img.shields.io/coveralls/asciidoctor/asciidoctor/master.svg[Coverage Status,link=https://coveralls.io/r/asciidoctor/asciidoctor] -//image:https://codeclimate.com/github/asciidoctor/asciidoctor/badges/gpa.svg[Code Climate,link=https://codeclimate.com/github/asciidoctor/asciidoctor] -image:https://inch-ci.org/github/asciidoctor/asciidoctor.svg?branch=master[Inline docs,link=https://inch-ci.org/github/asciidoctor/asciidoctor] -endif::[] - == スポンサー {uri-project}/supporters[スポンサー] のみなさまが, このプロジェクトをサポートし, より良いテクニカルドキュメンテーションの実現にコミットメントをしてくださっていることに感謝します. diff --git a/README-zh_CN.adoc b/README-zh_CN.adoc index d6ed5bcf..84274207 100644 --- a/README-zh_CN.adoc +++ b/README-zh_CN.adoc @@ -8,7 +8,6 @@ Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://g :language: {source-language} ifndef::env-github[:icons: font] ifdef::env-github[] -:status: :outfilesuffix: .adoc :caution-caption: :fire: :important-caption: :exclamation: @@ -88,15 +87,6 @@ Asciidoctor 也可以运行在 JavaScript 上。 Asciidoctor.js 被用于预览 AsciiDoc,支持 Chrome 扩展,Atom,Brackets 或其他基于 Web 的工具。 **** -ifdef::status[] -.*Project health* -image:https://img.shields.io/travis/asciidoctor/asciidoctor/master.svg[Build Status (Travis CI), link=https://travis-ci.org/asciidoctor/asciidoctor] -image:https://ci.appveyor.com/api/projects/status/ifplu67oxvgn6ceq/branch/master?svg=true&passingText=green%20bar&failingText=%23fail&pendingText=building%2E%2E%2E[Build Status (AppVeyor), link=https://ci.appveyor.com/project/asciidoctor/asciidoctor] -//image:https://img.shields.io/coveralls/asciidoctor/asciidoctor/master.svg[Coverage Status, link=https://coveralls.io/r/asciidoctor/asciidoctor] -//image:https://codeclimate.com/github/asciidoctor/asciidoctor/badges/gpa.svg[Code Climate, link="https://codeclimate.com/github/asciidoctor/asciidoctor"] -image:https://inch-ci.org/github/asciidoctor/asciidoctor.svg?branch=master[Inline docs, link="https://inch-ci.org/github/asciidoctor/asciidoctor"] -endif::[] - [#the-big-picture] == 整体概况 diff --git a/README.adoc b/README.adoc index ea888c09..ae98f60c 100644 --- a/README.adoc +++ b/README.adoc @@ -93,7 +93,7 @@ ifdef::status[] //.*Project health* image:https://img.shields.io/gem/v/asciidoctor.svg[Latest Release, link={uri-gem}] image:https://img.shields.io/badge/rubydoc.info-{release-version}-blue.svg[library (API) docs,link=https://www.rubydoc.info/gems/asciidoctor/{release-version}] -image:https://img.shields.io/travis/asciidoctor/asciidoctor/master.svg[Build Status (Travis CI),link=https://travis-ci.org/asciidoctor/asciidoctor] +image:https://github.com/asciidoctor/asciidoctor/workflows/CI/badge.svg[Build Status (GitHub Actions),link={uri-repo}/actions] image:https://ci.appveyor.com/api/projects/status/ifplu67oxvgn6ceq/branch/master?svg=true&passingText=green%20bar&failingText=%23fail&pendingText=building%2E%2E%2E[Build Status (AppVeyor),link=https://ci.appveyor.com/project/asciidoctor/asciidoctor] //image:https://img.shields.io/coveralls/asciidoctor/asciidoctor/master.svg[Coverage Status,link=https://coveralls.io/r/asciidoctor/asciidoctor] //image:https://codeclimate.com/github/asciidoctor/asciidoctor/badges/gpa.svg[Code Climate,link=https://codeclimate.com/github/asciidoctor/asciidoctor] diff --git a/tasks/dependents.rake b/tasks/dependents.rake index f7ae3bd1..bf3dded3 100644 --- a/tasks/dependents.rake +++ b/tasks/dependents.rake @@ -2,24 +2,22 @@ namespace :build do desc 'Trigger builds for all dependent projects on Travis CI and Github Actions' task :dependents do - next unless ENV['TRAVIS'].to_s == 'true' && - ENV['TRAVIS_PULL_REQUEST'].to_s == 'false' && - ENV['TRAVIS_TAG'].to_s.empty? + next unless ENV['GITHUB_ACTIONS'].to_s == 'true' && ENV['GITHUB_EVENT_NAME'].to_s != 'pull_request' && !(ENV['GITHUB_REF'].to_s.start_with? 'refs/tags/') - if (commit_hash = ENV['TRAVIS_COMMIT']) - commit_memo = %( (#{commit_hash.slice 0, 8})\n\nhttps://github.com/#{ENV['TRAVIS_REPO_SLUG'] || 'asciidoctor/asciidoctor'}/commit/#{commit_hash}) + if (commit_hash = ENV['GITHUB_SHA']) + commit_memo = %( (#{commit_hash.slice 0, 8})\n\nhttps://github.com/#{ENV['GITHUB_REPOSITORY'] || 'asciidoctor/asciidoctor'}/commit/#{commit_hash}) end - # NOTE The TRAVIS_TOKEN env var must be defined in the Travis interface. + # NOTE The TRAVIS_TOKEN env var must be defined in the CI interface. # Retrieve this token using the `travis token` command. # The GitHub user corresponding to the Travis user must have write access to the repository. # After granting permission, sign into Travis and resync the repositories. - travis_token = ENV['TRAVIS_TOKEN'] + travis_token = ENV['TRAVIS_API_TOKEN'] - # NOTE The GITHUB_TOKEN env var must be defined in the Travis interface. + # NOTE The GITHUB_TOKEN env var must be defined in the CI interface. # Retrieve this token using the settings of the account/org -> Developer Settings -> Personal Access Tokens # and generate a new "Personal Access Token" with the "repo" scope - github_token = ENV['GITHUB_TOKEN'] + github_token = ENV['GITHUB_API_TOKEN'] require 'json' require 'net/http' |
