Skip to content

Commit

Permalink
chore: Set up GitHub actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraichen committed Jul 20, 2024
1 parent 6700f48 commit e4a8e3b
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 20 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/maintenance-cache-wipe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: maintenance-cache-clear
on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:

jobs:
cache-clear:
runs-on: ubuntu-latest

steps:
- uses: easimon/wipe-cache@v2
17 changes: 17 additions & 0 deletions .github/workflows/maintenance-workflow-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: maintenance-workflow-cleanup
on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:

jobs:
delete-workflow-runs:
runs-on: ubuntu-latest
steps:
- uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 180
keep_minimum_runs: 50
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: test
on: push
jobs:
rspec:
name: "ruby-${{ matrix.ruby }}"
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
ruby:
- "3.3"
- "3.2"
- "3.1"
- "3.0"
- "2.7"

env:
BUNDLE_WITHOUT: development

steps:
- uses: actions/checkout@master

- run: |
sudo apt-get update --quiet
sudo apt-get install --quiet --yes libkrb5-dev
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3

- run: |
bundle exec rspec --color --format documentation
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in omniauth-kerberos.gemspec
gemspec

gem 'codeclimate-test-reporter', '~> 1.0'
gem 'rack-test'
gem 'rake'
gem 'rspec'

gem 'simplecov'
gem 'simplecov-cobertura'
16 changes: 10 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
require 'rspec'

if ENV['CI'] || (defined?(:RUBY_ENGINE) && RUBY_ENGINE != 'rbx')
begin
require 'simplecov'
SimpleCov.start
rescue LoadError
end
require 'simplecov'
require 'simplecov-cobertura'

SimpleCov.start do
add_filter 'spec'
end

SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::CoberturaFormatter,
]

require 'omniauth-kerberos'

Dir[File.expand_path('spec/support/**/*.rb')].each { |f| require f }
Expand Down

0 comments on commit e4a8e3b

Please sign in to comment.