mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Switch to github actions
👋 travis, it was nice while it lasted! ❤️
This commit is contained in:
parent
a3721cb298
commit
be6464ff83
7 changed files with 84 additions and 81 deletions
21
.github/workflows/linters.yml
vendored
Normal file
21
.github/workflows/linters.yml
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
name: Linters
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
rubocop:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
OSEM_RUBY_VERSION: 2.5.8
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.5
|
||||||
|
bundler-cache: true
|
||||||
|
- run: bundle exec rubocop
|
||||||
|
- run: bundle exec haml-lint app/views
|
||||||
34
.github/workflows/spec.yml
vendored
Normal file
34
.github/workflows/spec.yml
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
name: Specs
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
spec:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: spec
|
||||||
|
env:
|
||||||
|
OSEM_DB_ADAPTER: sqlite3
|
||||||
|
OSEM_RUBY_VERSION: 2.5.8
|
||||||
|
RAILS_ENV: test
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
suite: [models, features, controllers, ability, leftovers]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: ruby/setup-ruby@v1
|
||||||
|
with:
|
||||||
|
ruby-version: 2.5
|
||||||
|
bundler-cache: true
|
||||||
|
- name: Prepare spec
|
||||||
|
run: |
|
||||||
|
rm -f osem_test osem_development
|
||||||
|
bundle exec rake db:setup --trace
|
||||||
|
bundle exec bin/rails webdrivers:chromedriver:update
|
||||||
|
- name: spec/${{ matrix.suite }}
|
||||||
|
run: bundle exec rake spec:${{ matrix.suite }}
|
||||||
|
|
||||||
45
.travis.yml
45
.travis.yml
|
|
@ -1,45 +0,0 @@
|
||||||
sudo: required
|
|
||||||
dist: xenial
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- chromium-browser
|
|
||||||
language: ruby
|
|
||||||
cache: bundler
|
|
||||||
rvm:
|
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- /^depfu/.*$/
|
|
||||||
before_install:
|
|
||||||
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
|
|
||||||
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
|
|
||||||
- gem install bundler -v $(tail -n 1 Gemfile.lock)
|
|
||||||
notifications:
|
|
||||||
email:
|
|
||||||
on_success: change
|
|
||||||
on_failure: change
|
|
||||||
irc:
|
|
||||||
channels:
|
|
||||||
- "chat.freenode.net#osem"
|
|
||||||
on_success: change
|
|
||||||
on_failure: change
|
|
||||||
before_script:
|
|
||||||
- RAILS_ENV=test bundle exec rake db:bootstrap --trace
|
|
||||||
- RAILS_ENV=test bundle exec bin/rails webdrivers:chromedriver:update
|
|
||||||
script:
|
|
||||||
- "./travis_script.sh $TEST_SUITE"
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- OSEM_DB_ADAPTER=sqlite3
|
|
||||||
- OSEM_DB_HOST=''
|
|
||||||
- OSEM_DB_PORT=''
|
|
||||||
- OSEM_DB_NAME='osem_test'
|
|
||||||
matrix:
|
|
||||||
- TEST_SUITE=ability
|
|
||||||
- TEST_SUITE=features
|
|
||||||
- TEST_SUITE=linters
|
|
||||||
- TEST_SUITE=models
|
|
||||||
- TEST_SUITE=controllers
|
|
||||||
- TEST_SUITE=rest
|
|
||||||
matrix:
|
|
||||||
fast_finish: true
|
|
||||||
4
Gemfile
4
Gemfile
|
|
@ -234,8 +234,6 @@ group :development do
|
||||||
gem 'mina'
|
gem 'mina'
|
||||||
# as debugger on error pages
|
# as debugger on error pages
|
||||||
gem 'web-console'
|
gem 'web-console'
|
||||||
# as development database
|
|
||||||
gem 'sqlite3'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :test do
|
group :test do
|
||||||
|
|
@ -271,4 +269,6 @@ end
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
# as debugger
|
# as debugger
|
||||||
gem 'byebug'
|
gem 'byebug'
|
||||||
|
# as development/test database
|
||||||
|
gem 'sqlite3'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
[](https://travis-ci.org/openSUSE/osem)
|
[](https://travis-ci.org/openSUSE/osem)
|
||||||
|
[](https://github.com/openSUSE/osem/actions)
|
||||||
[](https://codeclimate.com/github/openSUSE/osem)
|
[](https://codeclimate.com/github/openSUSE/osem)
|
||||||
[](https://codecov.io/gh/opensuse/osem)
|
[](https://codecov.io/gh/opensuse/osem)
|
||||||
[](https://hakiri.io/github/openSUSE/osem/master)
|
[](https://hakiri.io/github/openSUSE/osem/master)
|
||||||
|
|
|
||||||
26
lib/tasks/spec.rake
Normal file
26
lib/tasks/spec.rake
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
unless Rails.env.production?
|
||||||
|
namespace :spec do
|
||||||
|
desc 'rspec ability'
|
||||||
|
task :ability do
|
||||||
|
sh 'bundle exec rspec --format documentation spec/ability'
|
||||||
|
end
|
||||||
|
desc 'rspec models'
|
||||||
|
task :models do
|
||||||
|
sh 'bundle exec rspec --format documentation spec/models'
|
||||||
|
end
|
||||||
|
desc 'rspec controllers'
|
||||||
|
task :controllers do
|
||||||
|
sh 'bundle exec rspec --format documentation spec/controllers'
|
||||||
|
end
|
||||||
|
desc 'rspec features'
|
||||||
|
task :features do
|
||||||
|
sh 'bundle exec rspec --format documentation spec/features'
|
||||||
|
end
|
||||||
|
desc 'rspec the leftovers'
|
||||||
|
task :leftovers do
|
||||||
|
sh 'bundle exec rspec --format documentation --exclude-pattern "spec/{models,features,controllers,ability}/**/*_spec.rb"'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# This script runs the test suites for the CI build
|
|
||||||
|
|
||||||
# Be verbose and fail script on the first error
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
# By default: all test runs
|
|
||||||
if [ -z $1 ]; then
|
|
||||||
TEST_SUITE="all"
|
|
||||||
else
|
|
||||||
TEST_SUITE="$1"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $TEST_SUITE in
|
|
||||||
linters)
|
|
||||||
bundle exec rubocop -Dc .rubocop.yml
|
|
||||||
bundle exec haml-lint app/views
|
|
||||||
;;
|
|
||||||
models)
|
|
||||||
bundle exec rspec --format documentation spec/models
|
|
||||||
;;
|
|
||||||
features)
|
|
||||||
bundle exec rspec --format documentation spec/features
|
|
||||||
;;
|
|
||||||
controllers)
|
|
||||||
bundle exec rspec --format documentation spec/controllers
|
|
||||||
;;
|
|
||||||
ability)
|
|
||||||
bundle exec rspec --format documentation spec/ability
|
|
||||||
;;
|
|
||||||
rest)
|
|
||||||
bundle exec rspec --format documentation --exclude-pattern "spec/{models,features,controllers,ability}/**/*_spec.rb"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue