Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile tweaks #2686

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/jobs/configure-checks/all.bats
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bats
#!/usr/bin/env bats --trace

load 'assert'

Expand Down Expand Up @@ -46,13 +46,13 @@ run_configure () {

repo-install () {
args=$(translate $@)
${cmd} install $args -y >/dev/null
${cmd} install $args -y
}
repo-remove () {
args=$(translate $@)
${cmd} remove $args -y #>/dev/null
if [ "$distro_id" != "ID=fedora" ]; then
apt-get autoremove -y 2>/dev/null
apt-get autoremove -y
fi
}

Expand Down Expand Up @@ -178,6 +178,8 @@ compile_assertions_finished () {
groupdel ${www_group} || true
done
repo-install httpd
grep -E 'nginx|apache' /etc/passwd || true
grep -E 'nginx|apache' /etc/group || true
run ./configure --with-domjudge-user=$u
assert_line "checking webserver-group... apache (detected)"
assert_line " * webserver group.....: apache"
Expand Down Expand Up @@ -210,7 +212,7 @@ compile_assertions_finished () {
@test "cgroup library needed" {
cgroup_init_find="checking for cgroup_init in -lcgroup... no"
cgroup_init_error="configure: error: Linux cgroup library not found."
setup_user
setup
repo-install gcc g++
repo-remove libcgroup-dev
run run_configure
Expand Down
23 changes: 18 additions & 5 deletions .github/jobs/configure-checks/setup_configure_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,30 @@ distro_id=$(grep "^ID=" /etc/os-release)
# Install everything for configure and testing
case $distro_id in
"ID=fedora")
dnf install pkg-config make bats autoconf automake util-linux -y ;;
grep -E 'nginx|apache' /etc/passwd || true
grep -E 'nginx|apache' /etc/group || true

dnf install -y pkg-config make bats autoconf automake util-linux \
httpd php-fpm

grep -E 'nginx|apache' /etc/passwd || true
grep -E 'nginx|apache' /etc/group || true
;;
*)
apt-get update; apt-get full-upgrade -y
apt-get install pkg-config make bats autoconf -y ;;
apt-get install -y pkg-config make bats autoconf composer \
php-fpm php-gd php-cli php-intl php-mbstring php-mysql \
php-curl php-json php-xml php-zip
;;
esac

# Build the configure file
# Start from a configured, distribution-ready source tree. Ideally,
# we'd like to call `make dist` but that depends on LaTeX for building
# the documentation, so take a shortcut.
make configure

# Install extra assert statements for bots
# Install extra assert statements for bats
cp submit/assert.bash .github/jobs/configure-checks/

# Run the configure tests for this usecase
test_path="/__w/domjudge/domjudge" bats .github/jobs/configure-checks/all.bats
test_path="/__w/domjudge/domjudge" bats --trace .github/jobs/configure-checks/all.bats
Loading