Skip to content

Commit

Permalink
Migrate to GitHub Actions from Travis CI
Browse files Browse the repository at this point in the history
Travis CI no longer has an "all you can eat" FLOSS offer, and all my credits are used up. Let's try GitHub Actions; it worked for the RubyGems folks with their nronn fork.

* #88
* n-ronn/nronn#8

Co-authored-by: Takuya Noguchi <[email protected]>
  • Loading branch information
apjanke and tnir committed Jan 6, 2023
1 parent 2bff97f commit f7c4eb6
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 26 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Ruby

on:
push:
branches: [ "main", "dev/gh-actions" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.unsupported }}
strategy:
fail-fast: false
matrix:
ruby-version: ['2.7', '3.0']
unsupported: [false]
include:
- ruby-version: '2.4'
unsupported: true
- ruby-version: '2.5'
unsupported: true
- ruby-version: '2.6'
unsupported: true
- ruby-version: '3.1'
unsupported: true
- ruby-version: head
unsupported: true

steps:
- uses: actions/checkout@v3
- name: Remove Gemfile.lock
run: rm -f Gemfile.lock
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
continue-on-error: ${{ matrix.unsupported }} # Only for Ruby 2.4
- name: Run tests
run: bundle exec rake test
continue-on-error: ${{ matrix.unsupported }}
- name: Run man tests
run: bundle exec rake man
continue-on-error: ${{ matrix.unsupported }} # Only for Ruby 2.4

rubocop:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Remove Gemfile.lock
run: rm -f Gemfile.lock
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: 2.7.6
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run RuboCop
run: bundle exec rubocop
34 changes: 34 additions & 0 deletions .github/workflows/jruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# We do not have plan to support
name: JRuby

on:
push:
branches: [ "main" ]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
ruby-version: [jruby-9.2.9.0, jruby-head]
continue-on-error: true

steps:
- uses: actions/checkout@v3
- name: Remove Gemfile.lock
run: rm -f Gemfile.lock
- name: Set up Ruby
uses: ruby/[email protected]
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rake test
continue-on-error: true
- name: Run man tests
run: bundle exec rake man
continue-on-error: true
57 changes: 57 additions & 0 deletions .github/workflows/pages.yml.OFF
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Currently broken and disabled.
# We don't have GitHub Pages set up yet. And it fails with this error
# anyway, in the 'bundle install' step:
# You are trying to install in deployment mode after changing
# your Gemfile.
name: Deploy to GitHub Pages
on:
push:
branches: [main]

permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Build job
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.2'
bundler-cache: true # 'bundle install' and cache

# cf. https://github.com/actions/starter-workflows/blob/4a8f18e34dd13d2b6ee4d8da2ba72629eafe1609/pages/jekyll.yml
- name: Setup Pages
id: pages
uses: actions/configure-pages@v1

- name: Build the pages
run: bundle exec rake man

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "man/" # The action will automatically upload an artifact from this directory

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions man/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>Ronn</title>
<title>nRonn: n.Ronn</title>
<style>
body {
font-size:24px;
Expand Down Expand Up @@ -41,7 +41,7 @@
</head>
<body>
<div id='index'>
<h1>Ronn</h1>
<h1>Ronn-NG</h1>
<h3>Builds manuals</h3>

<h4>Auxiliary</h4>
Expand Down Expand Up @@ -72,7 +72,7 @@ <h4>See Also</h4>
<a class='man-ref' href="http://mustache.github.com/mustache.5.html">mustache(5)</a>
</p>

<p class='copy'>Copyright &copy; 2010 Ryan Tomayko, &copy; 2018 Andrew Janke</p>
<p class='copy'>Copyright &copy; 2010 Ryan Tomayko, &copy; 2018, 2019, 2020, 2022 Andrew Janke, &copy; 2022 Takuya Noguchi</p>
</div>
</body>
</html>

0 comments on commit f7c4eb6

Please sign in to comment.