Skip to content

Commit

Permalink
Switch CI to Github actions
Browse files Browse the repository at this point in the history
travis-ci.org is dead. While there is travis-ci.com, Voxpupuli is
standardizing on Github Actions.

This adds testing on Ruby 2.6, 2.7 and 3.0.
  • Loading branch information
ekohl committed Aug 27, 2021
1 parent 59c7e24 commit f498188
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 29 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
if: github.repository_owner == 'voxpupuli'
steps:
- uses: actions/checkout@v2
- name: Install Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: Build gem
run: gem build *.gemspec
- name: Publish gem to rubygems.org
run: gem push *.gem
env:
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
- name: Setup GitHub packages access
run: |
mkdir -p ~/.gem
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
chmod 0600 ~/.gem/credentials
- name: Publish gem to GitHub packages
run: gem push --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test

on:
- pull_request
- push

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "2.4"
- "2.5"
- "2.6"
- "2.7"
- "3.0"
puppet:
- "7"
- "6"
- "5"
exclude:
- puppet: "7"
ruby: "2.4"
- puppet: "6"
ruby: "3.0"
- puppet: "5"
ruby: "3.0"
- puppet: "5"
ruby: "2.7"
name: Ruby ${{ matrix.ruby }} + Puppet ${{ matrix.puppet }}
env:
PUPPET_VERSION: "~> ${{ matrix.puppet }}.0"
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Show Puppet version
run: bundle exec puppet --version
- name: Run tests
run: bundle exec rake
- name: Verify gem builds
run: gem build *.gemspec
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

0 comments on commit f498188

Please sign in to comment.