Skip to content
Merged
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
40 changes: 34 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ on:

jobs:
test_sanity:
name: Sanity Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install docker-compose
run: sudo apt-get update && sudo apt-get install -y docker-compose
- name: Build the Docker images
run: docker compose -f docker-compose.test.yml build
run: docker compose -f docker-compose.test-mysql.yml build
- name: Run sanity tests
run: docker compose -f docker-compose.test.yml run --no-deps bugzilla6.test test_sanity t/*.t extensions/*/t/*.t
run: docker compose -f docker-compose.test-mysql.yml run --no-deps bugzilla6.test test_sanity t/*.t extensions/*/t/*.t

# test_webservices:
# runs-on: ubuntu-latest
Expand All @@ -31,22 +32,24 @@ jobs:
# - name: Install docker-compose
# run: sudo apt-get update && sudo apt-get install -y docker-compose
# - name: Build the Docker images
# run: docker compose -f docker-compose.test.yml build
# run: docker compose -f docker-compose.test-mysql.yml build
# - name: Run webservice tests
# run: docker compose -f docker-compose.test.yml run bugzilla6.test test_webservices
# run: docker compose -f docker-compose.test-mysql.yml run bugzilla6.test test_webservices

test_bugzilla6_mysql:
name: Interactive Tests with MySQL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install docker-compose
run: sudo apt-get update && sudo apt-get install -y docker-compose
- name: Build the Docker images
run: docker compose -f docker-compose.test.yml build
run: docker compose -f docker-compose.test-mysql.yml build
- name: Run bmo specific tests
run: docker compose -f docker-compose.test.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t
run: docker compose -f docker-compose.test-mysql.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t

test_bugzilla6_mariadb:
name: Interactive Tests with MariaDB
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -58,6 +61,7 @@ jobs:
run: docker compose -f docker-compose.test-mariadb.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t

test_bugzilla6_pg:
name: Interactive Tests with PostgreSQL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -69,6 +73,7 @@ jobs:
run: docker compose -f docker-compose.test-pg.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t

test_bugzilla6_sqlite:
name: Interactive Tests with SQLite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -79,3 +84,26 @@ jobs:
- name: Run bmo specific tests
run: docker compose -f docker-compose.test-sqlite.yml run -e CI=1 bugzilla6.test test_bmo -q -f t/bmo/*.t

test_release:
name: Perl Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t bugzilla-release-test -f docker/images/Dockerfile.perl-testsuite .
- name: Run tests
run: docker run --rm bugzilla-release-test

shellcheck:
name: ShellCheck (linting for shell scripts)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install ShellCheck
run: sudo apt-get update && sudo apt-get install -y shellcheck
- name: Run ShellCheck on all scripts
run: |
find . -type f -name '*.sh' | while read -r file; do
shellcheck -x "$file"
done
73 changes: 0 additions & 73 deletions .github/workflows/release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
version.json
__lbheartbeat__
.perl-version
*.bak

/skins/contrib/Dusk/admin.css
/skins/contrib/Dusk/bug.css
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG BZDB="-mysql"
FROM bugzilla/bugzilla-perl-slim${BZDB}:20250925.1

ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_FRONTEND=noninteractive

ENV LOG4PERL_CONFIG_FILE=log4perl-json.conf

Expand Down
File renamed without changes.
77 changes: 77 additions & 0 deletions docker/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.

##################################################
# Common checks and functions for docker scripts #
##################################################

# Function to print text in red if terminal supports it
echo_red() {
if [ -t 1 ] && command -v tput >/dev/null 2>&1 && [ "$(tput colors 2>/dev/null || echo 0)" -ge 8 ]; then
echo -e "\033[31m$1\033[0m"
else
echo "$1"
fi
}

# Function to print text in green if terminal supports it
echo_green() {
if [ -t 1 ] && command -v tput >/dev/null 2>&1 && [ "$(tput colors 2>/dev/null || echo 0)" -ge 8 ]; then
echo -e "\033[32m$1\033[0m"
else
echo "$1"
fi
}

# Check that we're in the root of the Bugzilla source tree
if [ ! -e 'Makefile.PL' ]; then
echo
echo_red "Please run this from the root of the Bugzilla source tree."
echo
exit 1
fi

# Find and validate the Docker executable
if [ -z "$DOCKER" ]; then
DOCKER=$(which docker)
fi
if [ -n "$DOCKER" ] && [ ! -x "$DOCKER" ]; then
echo
echo_red "You specified a custom Docker executable via the DOCKER"
echo_red "environment variable at $DOCKER"
echo_red "which either does not exist or is not executable."
echo "Please fix it to point at a working Docker or remove the"
echo "DOCKER environment variable to use the one in your PATH"
echo "if it exists."
echo
exit 1
fi
if [ -z "$DOCKER" ]; then
echo
echo_red "You do not appear to have docker installed or I can't find it."
echo "Windows and Mac versions can be downloaded from"
echo "https://www.docker.com/products/docker-desktop"
echo "Linux users can install using your package manager."
echo
echo "Please install docker or specify the location of the docker"
echo "executable in the DOCKER environment variable and try again."
echo
exit 1
fi

# Check that Docker daemon is running
if ! $DOCKER info >/dev/null 2>&1; then
echo
echo_red "The docker daemon is not running or I can't connect to it."
echo "Please make sure it's running and try again."
echo
exit 1
fi

# Disable Docker CLI hints
export DOCKER_CLI_HINTS=false
41 changes: 5 additions & 36 deletions docker/gen-cpanfile-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,18 @@
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.

if [ -z "$DOCKER" ]; then
DOCKER=`which docker`
fi
if [ ! -x "$DOCKER" ]; then
echo
echo "You specified a custom Docker executable via the DOCKER"
echo "environment variable at $DOCKER"
echo "which either does not exist or is not executable."
echo "Please fix it to point at a working Docker or remove the"
echo "DOCKER environment variable to use the one in your PATH"
echo "if it exists."
echo
exit -1
fi
if [ -z "$DOCKER" ]; then
echo
echo "You do not appear to have docker installed or I can't find it."
echo "Windows and Mac versions can be downloaded from"
echo "https://www.docker.com/products/docker-desktop"
echo "Linux users can install using your package manager."
echo
echo "Please install docker or specify the location of the docker"
echo "executable in the DOCKER environment variable and try again."
echo
exit -1
fi
$DOCKER info 1>/dev/null 2>/dev/null
if [ $? != 0 ]; then
echo
echo "The docker daemon is not running or I can't connect to it."
echo "Please make sure it's running and try again."
echo
exit -1
fi
# Source common Docker script checks and functions
# shellcheck source=docker/common.sh
source "$(dirname "$0")/common.sh"

if [ ! -f "docker/images/Dockerfile.cpanfile" ]; then
echo
echo "Can't locate the Dockerfile, try running from the root of"
echo "your Bugzilla checkout."
echo
exit -1
exit 1
fi

export DOCKER_CLI_HINTS=false
$DOCKER build -t bugzilla-cpanfile -f docker/images/Dockerfile.cpanfile .
$DOCKER run -it -v "$(pwd):/app/result" bugzilla-cpanfile cp cpanfile cpanfile.snapshot /app/result

Loading