Skip to content

Commit c75b880

Browse files
committed
WIP
1 parent d660df0 commit c75b880

File tree

9 files changed

+376
-256
lines changed

9 files changed

+376
-256
lines changed

.github/scripts/brew.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
set -eux
44

5-
# shellcheck disable=SC1091
6-
. .github/scripts/env.sh
7-
85
if [ -e "$HOME/.brew" ] ; then
96
(
107
cd "$HOME/.brew"
@@ -16,10 +13,10 @@ else
1613
fi
1714
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
1815

19-
mkdir -p "$CI_PROJECT_DIR/.brew_cache"
20-
export HOMEBREW_CACHE="$CI_PROJECT_DIR/.brew_cache"
21-
mkdir -p "$CI_PROJECT_DIR/.brew_logs"
22-
export HOMEBREW_LOGS="$CI_PROJECT_DIR/.brew_logs"
16+
mkdir -p "$GITHUB_WORKSPACE/.brew_cache"
17+
export HOMEBREW_CACHE="$GITHUB_WORKSPACE/.brew_cache"
18+
mkdir -p "$GITHUB_WORKSPACE/.brew_logs"
19+
export HOMEBREW_LOGS="$GITHUB_WORKSPACE/.brew_logs"
2320
mkdir -p /private/tmp/.brew_tmp
2421
export HOMEBREW_TEMP=/private/tmp/.brew_tmp
2522

.github/scripts/build.sh

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,24 @@
22

33
set -eux
44

5-
# shellcheck disable=SC1091
6-
. .github/scripts/env.sh
7-
# shellcheck disable=SC1091
8-
. .github/scripts/common.sh
9-
105
uname -a
116
uname -p
127
uname
138
pwd
149
env
1510

16-
# ensure ghcup
17-
install_ghcup
11+
if [ "${RUNNER_OS}" = Windows ] ; then
12+
ext=".exe"
13+
else
14+
ext=""
15+
fi
1816

1917
# build
20-
ghcup install ghc "${GHC_VERSION}"
21-
ghcup set ghc "${GHC_VERSION}"
18+
ghcup --no-verbose install ghc --set --install-targets "install_bin install_lib update_package_db" "${GHC_VERSION}"
2219
sed -i.bak -e '/DELETE MARKER FOR CI/,/END DELETE/d' cabal.project # see comment in cabal.project
23-
ecabal update
24-
ecabal user-config diff
25-
ecabal user-config init -f
20+
cabal update
21+
cabal user-config diff
22+
cabal user-config init -f
2623
"ghc-${GHC_VERSION}" --info
2724
"ghc" --info
2825

@@ -40,28 +37,27 @@ args=(
4037
${ADD_CABAL_ARGS}
4138
)
4239

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

45-
mkdir -p "$CI_PROJECT_DIR/out"
42+
mkdir -p "out"
4643
# shellcheck disable=SC2154
47-
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"
49-
cp dist-newstyle/cache/plan.json "$CI_PROJECT_DIR/out/plan.json"
50-
cd "$CI_PROJECT_DIR/out/"
44+
cp "$(cabal list-bin "${args[@]}" cabal-install:exe:cabal)" "out/cabal$ext"
45+
cp dist-newstyle/cache/plan.json "out/plan.json"
46+
cd "out/"
5147

5248
# create tarball/zip
53-
TARBALL_PREFIX="cabal-install-$("$CI_PROJECT_DIR/out/cabal" --numeric-version)"
49+
TARBALL_PREFIX="cabal-install-$("./cabal" --numeric-version)"
5450
case "${TARBALL_EXT}" in
5551
zip)
56-
zip "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" "cabal-tests${ext}" plan.json
52+
zip "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" plan.json
5753
;;
5854
tar.xz)
59-
tar caf "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" "cabal-tests${ext}" plan.json
55+
tar caf "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" plan.json
6056
;;
6157
*)
6258
fail "Unknown TARBALL_EXT: ${TARBALL_EXT}"
6359
;;
6460
esac
6561

66-
rm "cabal${ext}" "cabal-tests${ext}" plan.json
62+
rm "cabal${ext}" plan.json
6763

.github/scripts/common.sh

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

.github/scripts/env.sh

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

.github/scripts/test.sh

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,33 @@
22

33
set -eux
44

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
145
env
6+
pwd
7+
ls -lah
8+
9+
cd out
10+
case "${TARBALL_EXT}" in
11+
zip)
12+
unzip ./cabal-install-*-"${ARTIFACT}.${TARBALL_EXT}"
13+
;;
14+
tar.xz)
15+
tar xf ./cabal-install-*-"${ARTIFACT}.${TARBALL_EXT}"
16+
;;
17+
*)
18+
fail "Unknown TARBALL_EXT: ${TARBALL_EXT}"
19+
;;
20+
esac
21+
cd ..
22+
23+
ghcup --no-verbose install ghc --set --install-targets "install_bin install_lib update_package_db" "${GHC_VERSION}"
1524

16-
cd "$CI_PROJECT_DIR/out/"
25+
cabal update
1726

18-
"$(pwd)/cabal-tests$ext" --with-cabal "$(pwd)/cabal$ext"
27+
# TODO: we want to avoid building here... we should just
28+
# be using the previously built 'cabal-tests' binary
29+
cabal run ${ADD_CABAL_ARGS} cabal-testsuite:cabal-tests -- \
30+
--with-cabal "$(pwd)/out/cabal" \
31+
--intree-cabal-lib "$(pwd)" \
32+
--test-tmp "$(pwd)/testdb" \
33+
-j "$(nproc)"
1934

0 commit comments

Comments
 (0)