Skip to content

Commit 200579a

Browse files
committed
Migrate Copr build from Travis CI to GitHub Actions
1 parent 993cb66 commit 200579a

File tree

8 files changed

+69
-70
lines changed

8 files changed

+69
-70
lines changed

.github/setup/README

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Scripts in this directory
2+
-------------------------
3+
4+
copr-build-setup
5+
Use this script to configure the remote Fedora Copr projects/packages. It
6+
uploads the 'copr-custom-script' script. Execute: ./copr-custom-script
7+
8+
copr-custom-script
9+
This shell script is used on the Copr side to build the package from the
10+
remote push (this) or pull (fork) repository.

.github/setup/copr-build-setup

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /bin/bash -x
2+
3+
# Helper script to update CI scripting on Copr side
4+
5+
script=$(readlink -f "$(dirname "$0")")/copr-custom-script
6+
script_resultdir=srpm_results
7+
pkgname=csdiff
8+
9+
PROJECT_PR=@codescan/csdiff-pull-requests
10+
PROJECT_PUSH=@codescan/csdiff
11+
12+
build_deps=(
13+
boost-devel
14+
bsdtar
15+
cmake
16+
coreutils
17+
gcc-c++
18+
git
19+
make
20+
)
21+
22+
copr_cmd=(
23+
copr edit-package-custom \
24+
--webhook-rebuild on \
25+
--script "$script" \
26+
--script-chroot "fedora-latest-x86_64" \
27+
--script-builddeps "${build_deps[*]}" \
28+
--name "$pkgname" \
29+
--script-resultdir "$script_resultdir"
30+
)
31+
32+
"${copr_cmd[@]}" "$PROJECT_PR" --max-builds 20
33+
"${copr_cmd[@]}" "$PROJECT_PUSH"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ git clone \
2727
# checkout requested revision
2828
cd "$workdir"
2929

30-
test -f "$hook_payload" && copr-travis-checkout "$hook_payload"
30+
test -f "$hook_payload" && webook-checkout "$hook_payload"
3131

3232
./make-srpm.sh |& tee srpm-build.log
3333
srpm=$(grep Wrote: srpm-build.log | cut -d' ' -f2)

.github/workflows/copr-build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: RPM build in Fedora Copr
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
name: Submit a Copr build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out proper version of sources
16+
uses: actions/checkout@v1
17+
18+
- name: Submit the build
19+
env:
20+
COPR_PR_WEBHOOK: https://copr.fedorainfracloud.org/webhooks/custom/46962/a72fe511-c141-4f27-b7cf-de03c065e64e/csdiff/
21+
COPR_PUSH_WEBHOOK: ${{ secrets.COPR_PUSH_WEBHOOK }}
22+
run: |
23+
curl https://raw.githubusercontent.com/praiskup/copr-ci-tooling/main/copr-gh-actions-submit > submit
24+
bash submit ${{ github.event.pull_request.number }}

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ if: branch = main
55

66
matrix:
77
include:
8-
- name: "Fedora Copr build"
9-
dist: focal
10-
env:
11-
- COPR_BUILD=yes
12-
138
- name: "Ubuntu LTS 2014 (trusty)"
149
dist: trusty
1510

@@ -26,4 +21,4 @@ install:
2621
- sudo apt-get install cmake help2man libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev
2722

2823
script:
29-
- if test -z "$COPR_BUILD"; then make distcheck; else ./.travis/copr-build ; fi
24+
- make distcheck

.travis/README

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

.travis/copr-build

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

.travis/copr-build-setup

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

0 commit comments

Comments
 (0)