Move ruby testing to GH Actions & fix linting

This commit is contained in:
Gene Liverman 2022-06-25 14:49:22 -04:00
parent b6c4139be4
commit d2efca732c
No known key found for this signature in database
GPG key ID: 3AF83985B6C857C6
7 changed files with 29 additions and 30 deletions

20
.github/workflows/ruby.yml vendored Normal file
View file

@ -0,0 +1,20 @@
name: Ruby
on:
pull_request:
jobs:
ruby_testing:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: ['2.6', '2.7', '3.0', '3.1']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: bundle exec rake tests

View file

@ -1,22 +0,0 @@
language: ruby
cache: bundler
os:
- linux
# - osx
rvm:
- 2.5
- 2.6
- 2.7
before_install:
- gem update --system
- gem --version
script: 'bundle exec rake tests'
notifications:
slack:
on_success: always
secure: "HLf1vdPyg/2ezvShnwmRRtkXXap2yrMCsbU9Ow2moIhdPfDBhecXBBUsZ7/9vkIq6aTjvNb40708Q72Ndhycr1v9BE4y1KGTxcid99IhRuQEBFKkJRQpRSAqUhKq46hgUb986alQ5NoxYfMgXIC9+HzQYkoM1TXVrS3+D0cqBpkjUGl5pBG2DCa6nyAVeXzmVcs4+xeEOhkblfE5I7mXiFO0/aVcUeo+TYwSwDslPWx8OFd2PJjuceLMM8B1iBk4zY47FMdveUSA4lDQAtYMantiJvUrAGcyOUNEQZ8AsvVHuYW4HL3h3dvKXy6DM9ejwYxSFIYYtDlfCvTkY/m5HPCXvwLjABxV1JGCNkVs2vhmiCcvKSt4T4IdPxoGnMiT0UljVke5SY16hYaHkoaBtuzkRqCkRjD+nyPH5Y90c4D0uhrlob9dmUS7RkRqIZRDoaPoNS2xfrIHyEpsaXYr4rY0gBVB+ILd1DWJPIyAjRURkOVxKg1+0Tslq3B1FLAMmW/SkqYTtek680I5r+BDPFA9Eo+hxYqpWed/j68imRy6x6ZvwjS0ku+TG1G4z3P0W0wbys31/uC0PRP6YRJt1APKYxzP13rMWc21LXJoUgFtu19PbaCG2tHeb2oEdWkv3ilbbpMogjkU0+lrBP3ZLSIduuEvDDC9kpQy6Nrea5Y="

View file

@ -195,7 +195,7 @@ GEM
tty-screen (~> 0.8)
wisper (~> 2.0)
tty-screen (0.8.1)
unicode-display_width (2.1.0)
unicode-display_width (2.2.0)
webrick (1.7.0)
wisper (2.0.1)
xmlrpc (0.3.2)
@ -204,8 +204,7 @@ GEM
trollop (~> 2)
PLATFORMS
ruby
x86_64-darwin-16
x86_64-darwin-19
x86_64-linux
DEPENDENCIES
@ -236,4 +235,4 @@ DEPENDENCIES
yamllint (~> 0.0.9)
BUNDLED WITH
2.2.16
2.3.5

View file

@ -1,6 +1,7 @@
# dots
[![Ansible Lint](https://github.com/genebean/dots/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/genebean/dots/actions/workflows/ansible-lint.yml)
[![Ruby](https://github.com/genebean/dots/actions/workflows/ruby.yml/badge.svg)](https://github.com/genebean/dots/actions/workflows/ruby.yml)
My dot files and a tool to deploy them, and the programs that use them, to
various OS's. Some additional tools that I consider part of my baseline setup

View file

@ -6,7 +6,7 @@ require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'tty-command'
require 'yamllint/rake_task'
require_relative 'bin/rake_tasks.rb'
require_relative 'bin/rake_tasks'
exclude_paths = [
'pkg/**/*',

View file

@ -5,7 +5,7 @@ require 'os'
require 'tty-command'
require 'tty-file'
require 'tty-prompt'
require_relative 'dotutils.rb'
require_relative 'dotutils'
cmd = TTY::Command.new
@prompt = TTY::Prompt.new(help_color: :magenta)

View file

@ -19,10 +19,11 @@ end
def rename_file(source, destination, action)
puts "#{destination} exists, renaming to #{destination}.predots"
File.rename(destination, "#{destination}.predots")
if action.eql?('link')
case action
when 'link'
puts "Linking #{destination} to #{source}"
File.symlink(source, destination)
elsif action.eql?('copy')
when 'copy'
puts "Copying #{destination} to #{source}"
FileUtils.cp_r(source, destination)
else