Skip to content

Commit

Permalink
ci: add github workflow
Browse files Browse the repository at this point in the history
cyrus-imapd has been relying on Travis CI for builds. And Travis CI
has been pretty unreliable for our use-case as we keep running out of
'free OSS credits'.
This commit adds support for Github Actions for builds.

While most of what we did with Travis worked with Actions, a minor
change in the how cassandane stops processes was also needed and is a
part of this commit. The change was to use `stop_command()` method
instead of `_stop_pid()` method directly, making sure that a
`waitpid()` call is made after a `kill()`.

Signed-off-by: Partha Susarla <mail@spartha.org>
  • Loading branch information
ajaysusarla authored and rjbs committed Oct 3, 2022
1 parent 09070f0 commit a387b2d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Cyrus IMAP CI

on:
push:
pull_request:
branches:
- master
- main
- cyrus-imapd-3.6
- cyrus-imapd-3.4
- cyrus-imapd-3.2
- cyrus-imapd-3.0
jobs:
build:
runs-on: ubuntu-latest
container:
image: cyrusimapdocker/cyrus-buster:latest
options: --sysctl net.ipv6.conf.all.disable_ipv6=0
steps:
- uses: actions/checkout@v3
- name: configure and build
run: |
./tools/build-with-cyruslibs.sh
- name: update jmap test suite
run: |
cd /srv/JMAP-TestSuite.git
git fetch
git checkout origin/master
git clean -f -x -d
cpanm --installdeps .
cd -
- name: run cassandane
run: |
cd cassandane
cp -af cassandane.ini.dockertests cassandane.ini
chown cyrus:mail cassandane.ini
make
setpriv --reuid=cyrus --regid=mail --clear-groups --inh-caps='-chown,-dac_override,-dac_read_search,-fowner,-fsetid,-kill,-setgid,-setuid,-setpcap,-linux_immutable,-net_bind_service,-net_broadcast,-net_admin,-net_raw,-ipc_lock,-ipc_owner,-sys_module,-sys_rawio,-sys_chroot,-sys_ptrace,-sys_pacct,-sys_admin,-sys_boot,-sys_nice,-sys_resource,-sys_time,-sys_tty_config,-mknod,-lease,-audit_write,-audit_control,-setfcap,-mac_override,-mac_admin,-syslog,-wake_alarm,-block_suspend,-audit_read,-cap_38,-cap_39,-cap_40' ./testrunner.pl -f pretty -j 4
cd -
2 changes: 1 addition & 1 deletion cassandane/Cassandane/Instance.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ sub stop
{
my $pid = $self->_read_pid_file($name);
next if (!defined $pid);
_stop_pid($pid)
$self->stop_command($pid)
or push @errors, "Cannot shut down $name pid $pid";
}
# Note: no need to reap this daemon which is not our child anymore
Expand Down

0 comments on commit a387b2d

Please sign in to comment.