Skip to content

Commit 24e629d

Browse files
committed
Switch from Travis to GitHub Actions
1 parent 5317d96 commit 24e629d

File tree

5 files changed

+74
-20
lines changed

5 files changed

+74
-20
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
3+
4+
name: CI
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
Tests:
10+
runs-on: ubuntu-latest
11+
container: registry.opensuse.org/devel/libraries/libyui/containers/libyui-devel:latest
12+
13+
steps:
14+
15+
- name: Git Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Install Dependencies
19+
run: zypper --non-interactive install --no-recommends 'rubygem(ruby:2.7.0:rubocop:0.41.2)' yast2-devtools
20+
21+
# just for easier debugging...
22+
- name: Inspect Installed Packages
23+
run: rpm -qa | sort
24+
25+
- name: Rubocop
26+
run: rubocop
27+
28+
- name: Package
29+
run: ./ci-build

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Libyui::Rake
22

3-
[![Build Status](https://travis-ci.org/libyui/libyui-rake.svg?branch=master
4-
)](https://travis-ci.org/libyui/libyui-rake)
3+
[![Workflow Status](https://github.com/libyui/libyui-rake/workflows/CI/badge.svg?branch=master)](
4+
https://github.com/libyui/libyui-rake/actions?query=branch%3Amaster)
55

66
Rake tasks to help with uniform handling of libyui related projects. It provides setup for
77
[packaging tasks](http://github.com/openSUSE/packaging_tasks) and add some additional tasks.
@@ -10,7 +10,7 @@ Rake tasks to help with uniform handling of libyui related projects. It provides
1010

1111
Create a `Rakefile` with this content:
1212

13-
```
13+
```ruby
1414
require "libyui/rake"
1515
```
1616

@@ -32,7 +32,7 @@ configuration choosing from a set of [targets
3232
definitions](https://github.com/libyui/libyui-rake/blob/master/data/targets.yml).
3333
For example, if you want to submit to SLE12, you can do:
3434

35-
```
35+
```ruby
3636
Libyui::Tasks.submit_to(:sle12)
3737
```
3838
This method can receive, as a second parameter, the path to your own

ci-build

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#! /bin/bash
2+
3+
#--
4+
# Copyright (C) 2021 SUSE LLC
5+
# This library is free software; you can redistribute it and/or modify
6+
# it only under the terms of version 2.1 of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation.
8+
#
9+
# This library is distributed in the hope that it will be useful, but WITHOUT
10+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12+
# details.
13+
#
14+
# You should have received a copy of the GNU Lesser General Public
15+
# License along with this library; if not, write to the Free Software
16+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
#++
18+
19+
set -e -x
20+
21+
# check the license and changelog then build the tarball
22+
rake package
23+
24+
# run the osc source validator to check the .spec and .changes locally
25+
(cd package && /usr/lib/obs/service/source_validator)
26+
27+
# Build the binary package locally, use plain "rpmbuild" to make it simple.
28+
# "osc build" is too resource hungry (builds a complete chroot from scratch).
29+
# Moreover it does not work in a Docker container (it fails when trying to mount
30+
# /proc and /sys in the chroot).
31+
cp package/* /usr/src/packages/SOURCES/
32+
rpmbuild -bb -D "jobs $(nproc)" --with coverage --nodeps package/*.spec
33+
34+
# test the %pre/%post scripts by installing/updating/removing the built packages
35+
# ignore the dependencies to make the test easier, as a smoke test it's good enough
36+
rpm -iv --force --nodeps /usr/src/packages/RPMS/*/*.rpm
37+
rpm -Uv --force --nodeps /usr/src/packages/RPMS/*/*.rpm
38+
39+
# get the plain package names and remove all packages at once
40+
mapfile -t packages < <(rpm -q --qf '%{NAME}\n' -p /usr/src/packages/RPMS/*/*.rpm)
41+
rpm -ev --nodeps "${packages[@]}"

0 commit comments

Comments
 (0)