Skip to content

Commit 970be4c

Browse files
committed
Run tests as part of the release
1 parent 3159b8b commit 970be4c

File tree

5 files changed

+158
-11
lines changed

5 files changed

+158
-11
lines changed

.github/scripts/build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,28 @@ args=(
4040
${ADD_CABAL_ARGS}
4141
)
4242

43-
run cabal v2-build "${args[@]}" cabal-install
43+
run cabal v2-build "${args[@]}" cabal-install cabal-testsuite
4444

4545
mkdir -p "$CI_PROJECT_DIR/out"
4646
# shellcheck disable=SC2154
4747
cp "$(cabal list-bin "${args[@]}" cabal-install:exe:cabal)" "$CI_PROJECT_DIR/out/cabal$ext"
48+
cp "$(cabal list-bin "${args[@]}" cabal-testsuite:cabal-tests)" "$CI_PROJECT_DIR/out/cabal-tests$ext"
4849
cp dist-newstyle/cache/plan.json "$CI_PROJECT_DIR/out/plan.json"
4950
cd "$CI_PROJECT_DIR/out/"
5051

5152
# create tarball/zip
5253
TARBALL_PREFIX="cabal-install-$("$CI_PROJECT_DIR/out/cabal" --numeric-version)"
5354
case "${TARBALL_EXT}" in
5455
zip)
55-
zip "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" plan.json
56+
zip "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" "cabal-tests${ext}" plan.json
5657
;;
5758
tar.xz)
58-
tar caf "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" plan.json
59+
tar caf "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" "cabal-tests${ext}" plan.json
5960
;;
6061
*)
6162
fail "Unknown TARBALL_EXT: ${TARBALL_EXT}"
6263
;;
6364
esac
6465

65-
rm cabal plan.json
66+
rm "cabal${ext}" "cabal-tests${ext}" plan.json
6667

.github/scripts/test.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -eux
4+
5+
# shellcheck disable=SC1091
6+
. .github/scripts/env.sh
7+
# shellcheck disable=SC1091
8+
. .github/scripts/common.sh
9+
10+
uname -a
11+
uname -p
12+
uname
13+
pwd
14+
env
15+
16+
cd "$CI_PROJECT_DIR/out/"
17+
18+
"$(pwd)/cabal-tests$ext" --with-cabal "$(pwd)/cabal$ext"
19+

.github/workflows/release.yaml

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,141 @@ jobs:
400400
path: |
401401
./out/*
402402
403+
test-linux:
404+
name: Test linux binaries
405+
runs-on: ubuntu-latest
406+
needs: ["build-linux"]
407+
env:
408+
TARBALL_EXT: tar.xz
409+
ARCH: 64
410+
DEBIAN_FRONTEND: noninteractive
411+
TZ: Asia/Singapore
412+
GHC_VERSION: 9.8.4
413+
strategy:
414+
fail-fast: false
415+
matrix:
416+
platform: [ { image: "debian:10"
417+
, installCmd: "apt-get update && apt-get install -y"
418+
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
419+
, DISTRO: "Debian"
420+
, ARTIFACT: "x86_64-linux-deb10"
421+
},
422+
{ image: "debian:11"
423+
, installCmd: "apt-get update && apt-get install -y"
424+
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
425+
, DISTRO: "Debian"
426+
, ARTIFACT: "x86_64-linux-deb11"
427+
},
428+
{ image: "debian:12"
429+
, installCmd: "apt-get update && apt-get install -y"
430+
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
431+
, DISTRO: "Debian"
432+
, ARTIFACT: "x86_64-linux-deb12"
433+
},
434+
{ image: "ubuntu:20.04"
435+
, installCmd: "apt-get update && apt-get install -y"
436+
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
437+
, DISTRO: "Ubuntu"
438+
, ARTIFACT: "x86_64-linux-ubuntu20.04"
439+
},
440+
{ image: "ubuntu:22.04"
441+
, installCmd: "apt-get update && apt-get install -y"
442+
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
443+
, DISTRO: "Ubuntu"
444+
, ARTIFACT: "x86_64-linux-ubuntu22.04"
445+
},
446+
{ image: "ubuntu:24.04"
447+
, installCmd: "apt-get update && apt-get install -y"
448+
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses6 libtinfo6 patchelf"
449+
, DISTRO: "Ubuntu"
450+
, ARTIFACT: "x86_64-linux-ubuntu24.04"
451+
},
452+
{ image: "linuxmintd/mint20.3-amd64"
453+
, installCmd: "apt-get update && apt-get install -y"
454+
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
455+
, DISTRO: "Mint"
456+
, ARTIFACT: "x86_64-linux-mint20"
457+
},
458+
{ image: "linuxmintd/mint21.3-amd64"
459+
, installCmd: "apt-get update && apt-get install -y"
460+
, toolRequirements: "libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev libncurses5 libtinfo5 patchelf"
461+
, DISTRO: "Mint"
462+
, ARTIFACT: "x86_64-linux-mint21"
463+
},
464+
{ image: "fedora:33"
465+
, installCmd: "dnf install -y"
466+
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
467+
, DISTRO: "Fedora"
468+
, ARTIFACT: "x86_64-linux-fedora33"
469+
},
470+
{ image: "fedora:37"
471+
, installCmd: "dnf install -y"
472+
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
473+
, DISTRO: "Fedora"
474+
, ARTIFACT: "x86_64-linux-fedora37"
475+
},
476+
{ image: "rockylinux:8"
477+
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
478+
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
479+
, DISTRO: "Unknown"
480+
, ARTIFACT: "x86_64-linux-rocky8"
481+
},
482+
{ image: "rockylinux:9"
483+
, installCmd: "yum -y install epel-release && yum install -y --allowerasing"
484+
, toolRequirements: "autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf"
485+
, DISTRO: "Unknown"
486+
, ARTIFACT: "x86_64-linux-rocky9"
487+
},
488+
{ image: "alpine:latest"
489+
, installCmd: "apk update && apk add"
490+
, toolRequirements: "binutils-gold curl gcc g++ gmp-dev gmp-static libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static"
491+
, DISTRO: "Unknown"
492+
, ARTIFACT: "x86_64-linux-unknown"
493+
},
494+
{ image: "alpine:3.12"
495+
, installCmd: "apk update && apk add"
496+
, toolRequirements: "binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static"
497+
, DISTRO: "Unknown"
498+
, ARTIFACT: "x86_64-linux-alpine312"
499+
},
500+
{ image: "alpine:3.19"
501+
, installCmd: "apk update && apk add"
502+
, toolRequirements: "binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static"
503+
, DISTRO: "Unknown"
504+
, ARTIFACT: "x86_64-linux-alpine319"
505+
},
506+
{ image: "ghcr.io/void-linux/void-glibc:latest"
507+
, installCmd: "xbps-install -Suy xbps && xbps-install -Sy"
508+
, toolRequirements: "ncurses-libtinfo-libs autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils findutils gcc gmp gmp-devel jq lbzip2 make ncurses ncurses-devel openssh patch perl python3 sqlite sudo wget which xz tar zlib-devel patchelf"
509+
, DISTRO: "Unknown"
510+
, ARTIFACT: "x86_64-linux-void-glibc"
511+
}
512+
]
513+
container:
514+
image: ${{ matrix.platform.image }}
515+
steps:
516+
- name: Install requirements
517+
shell: sh
518+
run: |
519+
${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }}
520+
521+
- uses: actions/download-artifact@v4
522+
with:
523+
name: artifacts-${{ matrix.platform.ARTIFACT }}
524+
path: ./out
525+
526+
- uses: actions/checkout@v4
527+
528+
- name: Run test
529+
run: |
530+
bash .github/scripts/test.sh
531+
env:
532+
ARTIFACT: ${{ matrix.platform.ARTIFACT }}
533+
DISTRO: ${{ matrix.platform.DISTRO }}
534+
403535
release:
404536
name: release
405-
needs: ["build-linux", "build-linux-32bit", "build-arm", "build-mac-x86_64", "build-mac-aarch64", "build-win", "build-freebsd-x86_64"]
537+
needs: ["build-linux", "build-linux-32bit", "build-arm", "build-mac-x86_64", "build-mac-aarch64", "build-win", "build-freebsd-x86_64", "test-linux"]
406538
runs-on: ubuntu-latest
407539
if: startsWith(github.ref, 'refs/tags/')
408540
steps:

cabal-testsuite/cabal.project

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

project-cabal/pkgs/tests.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ packages:
33
, Cabal-tests
44
, Cabal-tree-diff
55
, cabal-validate
6+
, cabal-testsuite

0 commit comments

Comments
 (0)