Skip to content

Commit 41038d8

Browse files
committed
Split internals into their own package
Fixes #192
1 parent 367f6bf commit 41038d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1525
-109
lines changed

.github/workflows/test.yaml

+19-12
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,19 @@ jobs:
5050
set -eux
5151
[ "$(ghc --numeric-version)" = "${{ matrix.ghc }}" ]
5252
cabal update
53-
cabal build --enable-tests --enable-benchmarks
54-
cabal test
55-
cabal bench
56-
cabal haddock
53+
cabal build --enable-tests --enable-benchmarks all
54+
cabal test filepath
55+
cabal bench filepath
56+
cabal haddock filepath
57+
(
58+
cd filepath
5759
cabal check
58-
cabal sdist
60+
)
61+
(
62+
cd filepath-internals
63+
cabal check
64+
)
65+
cabal sdist all
5966
shell: bash
6067

6168
- if: matrix.os == 'ubuntu-latest'
@@ -64,7 +71,7 @@ jobs:
6471
set -eux
6572
export "PATH=$HOME/.cabal/bin:$PATH"
6673
cabal install --overwrite-policy=always --install-method=copy cpphs
67-
make all
74+
make -C filepath all
6875
git diff --exit-code
6976
7077
i386:
@@ -82,8 +89,8 @@ jobs:
8289
run: |
8390
. ~/.ghcup/env
8491
cabal update
85-
cabal test
86-
cabal bench
92+
cabal test filepath
93+
cabal bench filepath
8794
8895
# We use github.com/haskell self-hosted runners for ARM testing.
8996
# If they become unavailable in future, put ['armv7', 'aarch64']
@@ -107,13 +114,13 @@ jobs:
107114
uses: docker://hasufell/arm32v7-ubuntu-haskell:focal
108115
name: Run build (arm32v7 linux)
109116
with:
110-
args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2 && cabal bench -w ghc-9.2.2"
117+
args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2 filepath && cabal bench -w ghc-9.2.2 filepath"
111118

112119
- if: matrix.arch == 'arm64v8'
113120
uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
114121
name: Run build (arm64v8 linux)
115122
with:
116-
args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2 && cabal bench -w ghc-9.2.2"
123+
args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2 filepath && cabal bench -w ghc-9.2.2 filepath"
117124

118125
darwin_arm:
119126
runs-on: ${{ matrix.os }}
@@ -144,7 +151,7 @@ jobs:
144151
export RANLIB="$HOME/.brew/opt/llvm@11/bin/llvm-ranlib"
145152
. .github/scripts/env.sh
146153
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_GHC_VERSION=${{ matrix.ghc }} BOOTSTRAP_HASKELL_ADJUST_BASHRC=yes sh
147-
cabal test
148-
cabal bench
154+
cabal test filepath
155+
cabal bench filepath
149156
env:
150157
HOMEBREW_CHANGE_ARCH_TO_ARM: 1

README.md

-47
This file was deleted.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
filepath/README.md

cabal.project

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
packages: ./
1+
packages: ./filepath/filepath.cabal
2+
./filepath-internals/filepath-internals.cabal
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/sh
2+
3+
set -eux
4+
5+
. .github/scripts/env.sh
6+
7+
if [ -e "$HOME/.brew" ] ; then
8+
(
9+
cd "$HOME/.brew"
10+
git fetch --depth 1
11+
git reset --hard origin/master
12+
)
13+
else
14+
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.brew"
15+
fi
16+
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
17+
18+
mkdir -p $CI_PROJECT_DIR/.brew_cache
19+
export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
20+
mkdir -p $CI_PROJECT_DIR/.brew_logs
21+
export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
22+
mkdir -p /private/tmp/.brew_tmp
23+
export HOMEBREW_TEMP=/private/tmp/.brew_tmp
24+
25+
brew update
26+
brew install ${1+"$@"}
27+
28+
29+
set -eux
30+
31+
. .github/scripts/env.sh
32+
33+
if [ -e "$HOME/.brew" ] ; then
34+
(
35+
cd "$HOME/.brew"
36+
git fetch --depth 1
37+
git reset --hard origin/master
38+
)
39+
else
40+
git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.brew"
41+
fi
42+
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$PATH"
43+
44+
mkdir -p $CI_PROJECT_DIR/.brew_cache
45+
export HOMEBREW_CACHE=$CI_PROJECT_DIR/.brew_cache
46+
mkdir -p $CI_PROJECT_DIR/.brew_logs
47+
export HOMEBREW_LOGS=$CI_PROJECT_DIR/.brew_logs
48+
mkdir -p /private/tmp/.brew_tmp
49+
export HOMEBREW_TEMP=/private/tmp/.brew_tmp
50+
51+
brew update
52+
brew install ${1+"$@"}
53+
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
3+
if [ "${RUNNER_OS}" = "Windows" ] ; then
4+
ext=".exe"
5+
else
6+
ext=''
7+
fi
8+
9+
export DEBIAN_FRONTEND=noninteractive
10+
export TZ=Asia/Singapore
11+
12+
export OS="$RUNNER_OS"
13+
export PATH="$HOME/.local/bin:$PATH"
14+
15+
if [ "${RUNNER_OS}" = "Windows" ] ; then
16+
# on windows use pwd to get unix style path
17+
CI_PROJECT_DIR="$(pwd)"
18+
export CI_PROJECT_DIR
19+
export GHCUP_INSTALL_BASE_PREFIX="/c"
20+
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/ghcup/bin"
21+
export PATH="$GHCUP_BIN:$PATH"
22+
export CABAL_DIR="C:\\Users\\runneradmin\\AppData\\Roaming\\cabal"
23+
else
24+
export CI_PROJECT_DIR="${GITHUB_WORKSPACE}"
25+
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
26+
export GHCUP_BIN="$GHCUP_INSTALL_BASE_PREFIX/.ghcup/bin"
27+
export PATH="$GHCUP_BIN:$PATH"
28+
export CABAL_DIR="$CI_PROJECT_DIR/cabal"
29+
export CABAL_CACHE="$CI_PROJECT_DIR/cabal-cache"
30+
fi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: Haskell CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest]
17+
ghc: ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.2', '9.2.7', '9.4.5', '9.6.1']
18+
cabal: ['3.8.1.0']
19+
include:
20+
- os: macOS-latest
21+
ghc: '9.4.5'
22+
cabal: '3.8.1.0'
23+
- os: macOS-latest
24+
ghc: '9.6.1'
25+
cabal: '3.8.1.0'
26+
- os: windows-latest
27+
ghc: '9.4.5'
28+
cabal: '3.8.1.0'
29+
- os: windows-latest
30+
ghc: '9.6.1'
31+
cabal: '3.8.1.0'
32+
steps:
33+
- uses: actions/checkout@v3
34+
35+
- name: Install dependencies (Ubuntu)
36+
if: runner.os == 'Linux'
37+
run: |
38+
sudo apt-get -y update
39+
sudo apt-get -y install libtinfo5 libtinfo6 libncurses5 libncurses6
40+
41+
- name: Install ghc/cabal
42+
run: |
43+
set -eux
44+
ghcup install ghc --set ${{ matrix.ghc }}
45+
ghcup install cabal ${{ matrix.cabal }}
46+
shell: bash
47+
48+
- name: Build
49+
run: |
50+
set -eux
51+
[ "$(ghc --numeric-version)" = "${{ matrix.ghc }}" ]
52+
cabal update
53+
cabal build --enable-tests --enable-benchmarks
54+
cabal test
55+
cabal bench
56+
cabal haddock
57+
cabal check
58+
cabal sdist
59+
shell: bash
60+
61+
- if: matrix.os == 'ubuntu-latest'
62+
name: make all
63+
run: |
64+
set -eux
65+
export "PATH=$HOME/.cabal/bin:$PATH"
66+
cabal install --overwrite-policy=always --install-method=copy cpphs
67+
make all
68+
git diff --exit-code
69+
70+
i386:
71+
runs-on: ubuntu-latest
72+
container:
73+
image: i386/ubuntu:bionic
74+
steps:
75+
- name: Install
76+
run: |
77+
apt-get update -y
78+
apt-get install -y autoconf build-essential zlib1g-dev libgmp-dev curl libncurses5 libtinfo5 libncurses5-dev libtinfo-dev
79+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 sh
80+
- uses: actions/checkout@v1
81+
- name: Test
82+
run: |
83+
. ~/.ghcup/env
84+
cabal update
85+
cabal test
86+
cabal bench
87+
88+
# We use github.com/haskell self-hosted runners for ARM testing.
89+
# If they become unavailable in future, put ['armv7', 'aarch64']
90+
# back to emulation jobs above.
91+
arm:
92+
runs-on: [self-hosted, Linux, ARM64]
93+
strategy:
94+
fail-fast: true
95+
matrix:
96+
arch: [arm32v7, arm64v8]
97+
steps:
98+
- uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
99+
name: Cleanup
100+
with:
101+
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
102+
103+
- name: Checkout code
104+
uses: actions/checkout@v3
105+
106+
- if: matrix.arch == 'arm32v7'
107+
uses: docker://hasufell/arm32v7-ubuntu-haskell:focal
108+
name: Run build (arm32v7 linux)
109+
with:
110+
args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2 && cabal bench -w ghc-9.2.2"
111+
112+
- if: matrix.arch == 'arm64v8'
113+
uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
114+
name: Run build (arm64v8 linux)
115+
with:
116+
args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2 && cabal bench -w ghc-9.2.2"
117+
118+
darwin_arm:
119+
runs-on: ${{ matrix.os }}
120+
env:
121+
MACOSX_DEPLOYMENT_TARGET: 10.13
122+
strategy:
123+
fail-fast: false
124+
matrix:
125+
include:
126+
- os: [self-hosted, macOS, ARM64]
127+
ghc: 8.10.7
128+
- os: [self-hosted, macOS, ARM64]
129+
ghc: 9.2.6
130+
- os: [self-hosted, macOS, ARM64]
131+
ghc: 9.4.4
132+
steps:
133+
- name: Checkout code
134+
uses: actions/checkout@v3
135+
136+
- name: Run build
137+
run: |
138+
bash .github/scripts/brew.sh git coreutils llvm@11 autoconf automake
139+
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$HOME/.brew/opt/llvm@11/bin:$PATH"
140+
export CC="$HOME/.brew/opt/llvm@11/bin/clang"
141+
export CXX="$HOME/.brew/opt/llvm@11/bin/clang++"
142+
export LD=ld
143+
export AR="$HOME/.brew/opt/llvm@11/bin/llvm-ar"
144+
export RANLIB="$HOME/.brew/opt/llvm@11/bin/llvm-ranlib"
145+
. .github/scripts/env.sh
146+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_GHC_VERSION=${{ matrix.ghc }} BOOTSTRAP_HASKELL_ADJUST_BASHRC=yes sh
147+
cabal test
148+
cabal bench
149+
env:
150+
HOMEBREW_CHANGE_ARCH_TO_ARM: 1

0 commit comments

Comments
 (0)