Skip to content

Commit

Permalink
Merge ef4365b into 9e898e2
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Dec 9, 2020
2 parents 9e898e2 + ef4365b commit 78f14a4
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 25 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,82 @@

# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions

name: CI

on: [push, pull_request]

jobs:
Tests:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

# just for easier debugging...
- name: Inspect Installed Packages
run: rpm -qa | sort

- name: Unit Tests
run: rake test:unit
# enable code coverage reporting
env:
COVERAGE: 1

# send the coverage report to coveralls.io
- name: Coveralls Report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

Rubocop:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Rubocop
run: rake check:rubocop

Package:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Package Build
run: yast-ci-ruby -o package

Yardoc:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: Yardoc
run: rake check:doc

# downloading the Docker image takes some time so bundling several fast
# checks into one job avoids that overhead
Checks:
runs-on: ubuntu-latest
container: registry.opensuse.org/yast/head/containers/yast-ruby:latest

steps:

- name: Git Checkout
uses: actions/checkout@v2

- name: POT Check
run: rake check:pot
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions Dockerfile

This file was deleted.

10 changes: 6 additions & 4 deletions README.md
@@ -1,9 +1,11 @@
# YaST Firewall - Configures Firewalld #

[![Coverage
Status](https://coveralls.io/repos/github/yast/yast-firewall/badge.svg?branch=master)](https://coveralls.io/github/yast/yast-firewall?branch=master)
[![Travis Build](https://travis-ci.org/yast/yast-firewall.svg?branch=master)](https://travis-ci.org/yast/yast-firewall)
[![Jenkins Build](http://img.shields.io/jenkins/s/https/ci.opensuse.org/yast-firewall-master.svg)](https://ci.opensuse.org/view/Yast/job/yast-firewall-master/)
[![Workflow Status](https://github.com/yast/yast-firewall/workflows/CI/badge.svg?branch=master)](
https://github.com/yast/yast-firewall/actions?query=branch%3Amaster)
[![Jenkins Status](https://ci.opensuse.org/buildStatus/icon?job=yast-yast-firewall-master)](
https://ci.opensuse.org/view/Yast/job/yast-yast-firewall-master/)
[![Coverage Status](https://coveralls.io/repos/github/yast/yast-firewall/badge.svg?branch=master)](
https://coveralls.io/github/yast/yast-firewall?branch=master)


Since the adoption of `firewalld` this repository contains just some useful
Expand Down
1 change: 1 addition & 0 deletions test/lib/y2firewall/dialogs/main_test.rb
Expand Up @@ -30,6 +30,7 @@
before do
firewall.reset
allow(firewall).to receive(:read)
allow(firewall).to receive(:write_only).and_return(true)
allow_any_instance_of(Y2Firewall::Widgets::OverviewTreePager)
.to receive(:items).and_return([])
end
Expand Down
28 changes: 22 additions & 6 deletions test/test_helper.rb
Expand Up @@ -33,9 +33,9 @@ def stub_module(name, fake_class = nil)
end

# stub classes from other modules to speed up a build
stub_module("AutoInstall")
# rubocop:disable Style/SingleLineMethods
# rubocop:disable Style/MethodName
stub_module("AutoInstall", Class.new { def self.issues_list; []; end })
stub_module("UsersSimple", Class.new { def self.GetRootPassword; "secret"; end })
# rubocop:enable Style/SingleLineMethods
# rubocop:enable Style/MethodName
Expand All @@ -44,6 +44,14 @@ def stub_module(name, fake_class = nil)
ENV["LANG"] = "en_US.UTF-8"
ENV["LC_ALL"] = "en_US.UTF-8"

RSpec.configure do |config|
config.mock_with :rspec do |c|
# make sure we mock only the existing methods
# https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/verifying-doubles/partial-doubles
c.verify_partial_doubles = true
end
end

if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start do
Expand All @@ -53,12 +61,20 @@ def stub_module(name, fake_class = nil)
# track all ruby files under src
SimpleCov.track_files("#{srcdir}/**/*.rb")

# use coveralls for on-line code coverage reporting at Travis CI
if ENV["TRAVIS"]
require "coveralls"
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [
# additionally use the LCOV format for on-line code coverage reporting at CI
if ENV["CI"] || ENV["COVERAGE_LCOV"]
require "simplecov-lcov"

SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
# this is the default Coveralls GitHub Action location
# https://github.com/marketplace/actions/coveralls-github-action
c.single_report_path = "coverage/lcov.info"
end

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
SimpleCov::Formatter::LcovFormatter
]
end
end

0 comments on commit 78f14a4

Please sign in to comment.