Skip to content

Commit

Permalink
Convert from Travis CI to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Mar 11, 2022
1 parent 09ce246 commit 1bc72b5
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 48 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Test

on:
pull_request: {}
push:
branches: master

env:
BUNDLE_WITHOUT: development:release

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "3.1"
- "3.0"
- "2.7"
- "2.6"
- "2.5"
- "2.4"
puppet:
- "~> 7.0"
- "~> 6.5"
- "~> 5.5.10"
- "https://github.com/puppetlabs/puppet.git#main"
exclude:
- ruby: "2.6"
puppet: "~> 7.0"
- ruby: "2.5"
puppet: "~> 7.0"
- ruby: "2.4"
puppet: "~> 7.0"

- ruby: "3.1"
puppet: "~> 6.5"
- ruby: "3.0"
puppet: "~> 6.5"

- ruby: "3.1"
puppet: "~> 5.5.10"
- ruby: "3.0"
puppet: "~> 5.5.10"
- ruby: "2.7"
puppet: "~> 5.5.10"
- ruby: "2.6"
puppet: "~> 5.5.10"

- ruby: "2.6"
puppet: "https://github.com/puppetlabs/puppet.git#main"
- ruby: "2.5"
puppet: "https://github.com/puppetlabs/puppet.git#main"
- ruby: "2.4"
puppet: "https://github.com/puppetlabs/puppet.git#main"
name: "Ruby ${{ matrix.ruby }} - Puppet ${{ matrix.puppet }}"
env:
PUPPET_VERSION: ${{ matrix.puppet }}
steps:
- uses: actions/checkout@v3
- name: Install Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source 'https://rubygems.org'
# `git://somewhere.git#branch`. You can also use a file source location, which
# is specified as `file://some/location/on/disk`.
def location_for(place_or_version, fake_version = nil)
if place_or_version =~ /^(git[:@][^#]*)#(.*)/
if place_or_version =~ /^(https[:@][^#]*)#(.*)/
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
elsif place_or_version =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
Expand All @@ -19,12 +19,12 @@ gemspec

# Override gemspec for CI matrix builds.
# But only if the environment variable is set
gem 'puppet', *location_for(ENV['PUPPET_VERSION'] || '>= 5') if ENV['PUPPET_VERSION']
gem 'puppet', *location_for(ENV['PUPPET_VERSION']) if ENV['PUPPET_VERSION']

group :test do
gem 'rspec'
end

group :release do
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator'
gem 'github_changelog_generator', require: false
end
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/voxpupuli/puppet-syntax.svg?branch=master)](https://travis-ci.org/voxpupuli/puppet-syntax)
TODO: [![Build Status](https://travis-ci.org/voxpupuli/puppet-syntax.svg?branch=master)](https://travis-ci.org/voxpupuli/puppet-syntax)
[![Gem Version](https://img.shields.io/gem/v/puppet-syntax.svg)](https://rubygems.org/gems/puppet-syntax)
[![Gem Downloads](https://img.shields.io/gem/dt/puppet-syntax.svg)](https://rubygems.org/gems/puppet-syntax)

Expand All @@ -14,7 +14,7 @@ Puppet::Syntax is supported with:
- Puppet >= 5.0 that provides the `validate` face.
- Ruby >= 2.4

For the specific versions that we test against, see the [TravisCI config](.travis.yml).
For the specific versions that we test against, see the [GitHub Actions workflow](.github/workflows/test.yml).

## Installation

Expand Down

0 comments on commit 1bc72b5

Please sign in to comment.