Skip to content

Commit

Permalink
Merge branch 'harbour:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Petewg authored Feb 14, 2024
2 parents 5eac543 + 936bef2 commit 4004e96
Show file tree
Hide file tree
Showing 275 changed files with 285,354 additions and 185,523 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: linux-ci

on:
- push
- pull_request

jobs:
ubuntu-ci:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
compiler:
- clang
- gcc
strictness:
- "normal"
- "strict"

steps:

- name: Configure environment
shell: bash
run: |
echo "Nothing to do for Linux"
- name: Install packages
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -qq \
valgrind \
libncurses-dev \
libslang2-dev \
libx11-dev \
libgpm-dev \
liballegro4.2-dev \
libcairo2-dev \
libcups2-dev \
libcurl4-openssl-dev \
firebird-dev \
libgd-dev \
libgs-dev \
libmagic-dev \
libmysqlclient-dev \
unixodbc-dev \
libpq-dev \
qtbase5-dev
# Dependencies for disabled contribs:
# libfreeimage-dev \
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}

- run: pwd
- run: ls

- name: Prepare ccache using action
uses: hendrikmuhs/[email protected]
with:
key: linux-${{ matrix.compiler }}-${{ matrix.strictness }}-ci
max-size: "32M"

- name: Configure build shell
run: |
set -ex
HB_USER_CFLAGS=""
HB_USER_LDFLAGS=""
case ${{matrix.strictness}} in
normal) ;;
strict) case ${{matrix.compiler}} in
(gcc) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror -Wno-error=deprecated-declarations -Wno-error=array-bounds" ;;
(*) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror -Wno-error=deprecated-declarations" ;;
esac ;;
esac
tee ./.bashrc <<EOENV
# These contribs do not build on any platform
export HB_BUILD_CONTRIBS="no hbfimage" # incompatible with freeimage 3.18+
export HB_BUILD_VERBOSE="yes"
export HBMK_WITH_SQLITE3="local"
export HB_USER_CFLAGS="$HB_USER_CFLAGS"
export HB_USER_LDFLAGS="$HB_USER_LDFLAGS"
export HB_CCACHE=ccache
EOENV
- name: Build Harbour
run: |
echo ::group::Build Harbour
set -ex
. ./.bashrc
make -j$(nproc) \
HB_BUILD_CONTRIBS=no \
HB_COMPILER=${{matrix.compiler}}
- name: Build contribs
run: |
echo ::group::Build contribs
set -ex
. ./.bashrc
make -j$(nproc) \
-C contrib \
HB_COMPILER=${{matrix.compiler}}
- name: Run tests
run: |
echo ::group::Run tests
set -ex
VALGRIND="valgrind --error-exitcode=1"
$VALGRIND bin/linux/${{matrix.compiler}}/hbtest
cd contrib/hbsqlit3/tests
../../../bin/linux/${{matrix.compiler}}/hbmk2 backup.prg
$VALGRIND ./backup
105 changes: 105 additions & 0 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: macos-ci

on:
- push
- pull_request

jobs:
macos-ci:
runs-on: macos-latest

strategy:
fail-fast: false
matrix:
compiler:
- clang
- gcc
strictness:
- "normal"
- "strict"

steps:

- name: Configure environment
run: |
echo "Nothing to do for Macos"
- name: Install packages
run: |
brew install \
$(case ${{matrix.compiler }} in
(gcc) echo ${{matrix.compiler}} ;; esac) \
slang \
cairo \
libgd \
mysql \
postgresql \
qt5
# Dependencies for disabled contribs:
# freeimage \
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}

- run: pwd
- run: ls

- name: Prepare ccache using action
uses: hendrikmuhs/[email protected]
with:
key: macos-${{ matrix.cpu }}-${{ matrix.compiler }}-${{ matrix.strictness }}-ci
max-size: "32M"

- name: Configure build shell
run: |
set -ex
HB_USER_CFLAGS="-arch arm64 -arch x86_64"
HB_USER_LDFLAGS="-arch arm64 -arch x86_64"
case ${{matrix.strictness}} in
normal) ;;
strict) case ${{matrix.compiler}} in
(gcc) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror -Wno-error=deprecated-declarations -Wno-error=array-bounds" ;;
(*) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror -Wno-error=deprecated-declarations" ;;
esac ;;
esac
tee ./.bashrc <<EOENV
# These contribs do not build on any platform
export HB_BUILD_CONTRIBS="no hbfimage" # incompatible with freeimage 3.18+
export HB_BUILD_VERBOSE="yes"
export HBMK_WITH_SQLITE3="local"
export HB_USER_CFLAGS="$HB_USER_CFLAGS"
export HB_USER_LDFLAGS="$HB_USER_LDFLAGS"
export HB_CCACHE=ccache
case ${{matrix.compiler}} in
gcc) latest_gcc="\$(cd /usr/local/bin && ls gcc-[1-9]* | sort -n | tail -1)"
export HB_CCSUFFIX="\${latest_gcc#gcc}" ;;
esac
EOENV
- name: Build Harbour
run: |
echo ::group::Build Harbour
set -ex
. ./.bashrc
make -j$(sysctl -n hw.ncpu) \
HB_BUILD_CONTRIBS=no \
HB_COMPILER=${{matrix.compiler}}
- name: Build contribs
run: |
echo ::group::Build contribs
set -ex
. ./.bashrc
make -j$(sysctl -n hw.ncpu) \
-C contrib \
HB_COMPILER=${{matrix.compiler}}
- name: Run tests
run: |
echo ::group::Run tests
set -ex
bin/darwin/${{matrix.compiler}}/hbtest
166 changes: 166 additions & 0 deletions .github/workflows/vm1-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: vm1-ci

on:
- push
- pull_request

jobs:
vm1-ci:
runs-on: macos-latest

strategy:
fail-fast: false
matrix:
os:
- name: freebsd
version: "13.2"
- name: netbsd
version: "9.3"
- name: openbsd
version: "7.4"
compiler:
- clang
- gcc
strictness:
- "normal"
- "strict"
exclude:
- os: {name: netbsd}
compiler: clang
- os: {name: openbsd}
compiler: gcc
# cross-platform-actions/[email protected] works for FreeBSD but hangs often
- os: {name: freebsd}

steps:

- name: Configure environment
run: |
echo "Nothing to do for ${{ matrix.os.name }}"
- name: Install packages
run: |
echo "The actual install takes place in the VM in the build step"
tee ~/work/install_freebsd_deps.sh <<EOF
#!/bin/sh
sudo pkg install -y \
bison ccache gmake \
$(case ${{matrix.compiler }} in
(gcc) echo ${{matrix.compiler}} ;; esac) \
libslang2 \
cairo \
libgd \
mariadb-connector-c \
postgresql16-client \
qt5-buildtools qt5-gui
EOF
# Dependencies for disabled contribs:
# freeimage \
tee ~/work/install_netbsd_deps.sh <<EOF
#!/bin/sh
set -ex
sudo pkgin -y install \
bison ccache gmake
EOF
tee ~/work/install_openbsd_deps.sh <<EOF
#!/bin/sh
set -ex
sudo pkg_add \
bison ccache gmake \
$(case ${{matrix.compiler }} in
(gcc) echo ${{matrix.compiler}} ;; esac)
EOF
chmod a+x ~/work/install_*_deps.sh
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.client_payload.branch }}

- run: pwd
- run: ls

- name: Prepare ccache using action
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os.name }}-${{ matrix.os.version }}-${{ matrix.compiler }}-${{ matrix.strictness }}-ci
max-size: "32M"

- name: Configure build shell
run: |
set -ex
case ${{matrix.os.name }} in
*bsd) _cpus="sysctl -n hw.ncpu" ;;
esac
HB_USER_CFLAGS=""
HB_USER_LDFLAGS=""
case ${{matrix.strictness}} in
normal) ;;
strict) case ${{matrix.compiler}} in
(gcc) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror -Wno-error=deprecated-declarations -Wno-error=array-bounds" ;;
(*) HB_USER_CFLAGS="$HB_USER_CFLAGS -Werror" ;;
esac ;;
esac
tee ./.bashrc <<EOENV
# These contribs do not build on any platform
export HB_BUILD_CONTRIBS="no hbfimage" # incompatible with freeimage 3.18+
export HB_BUILD_VERBOSE="yes"
export HBMK_WITH_SQLITE3="local"
export HB_USER_CFLAGS="$HB_USER_CFLAGS"
export HB_USER_LDFLAGS="$HB_USER_LDFLAGS"
export HB_CCACHE=ccache
export N_CPUS="\$($_cpus)"
EOENV
- name: Generate build script
run: |
tee ~/work/run_build.sh <<'EOF'
set -ex
echo "::group::Configure ccache in VM"
ccache --set-config="cache_dir=$(pwd)/.ccache"
ccache --set-config=max_size=32M
ccache --set-config=compression=true
ccache -p
echo ::group::Build Harbour
set -ex
. ./.bashrc
gmake -j$N_CPUS \
HB_BUILD_CONTRIBS=no \
HB_COMPILER=${{matrix.compiler}}
echo "::group::Build contribs"
set -ex
. ./.bashrc
gmake -j$N_CPUS \
-C contrib \
HB_COMPILER=${{matrix.compiler}}
echo "::group::Run tests"
set -ex
bin/*/${{matrix.compiler}}/hbtest
EOF
- name: Build Harbour and contribs
timeout-minutes: 30
uses: cross-platform-actions/[email protected]
with:
operating_system: ${{ matrix.os.name }}
architecture: x86_64
version: "${{ matrix.os.version }}"
shell: bash
memory: 2G
cpu_count: 3
sync_files: "true"
run: |
echo "::group::Install dependencies"
set -ex
~/work/install_${{ matrix.os.name }}_deps.sh
. ~/work/run_build.sh
Loading

0 comments on commit 4004e96

Please sign in to comment.