Skip to content

Commit 294d72f

Browse files
committed
Merge branch 'master' into build
2 parents 6a4f2bb + de95f33 commit 294d72f

File tree

22 files changed

+2318
-241
lines changed

22 files changed

+2318
-241
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please don't forget to add to the "WIP" section of the changelog!

.github/workflows/ci.yml

Lines changed: 60 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -4,89 +4,75 @@ on: [pull_request]
44

55
jobs:
66
cabal:
7-
7+
name: "Cabal: ${{ matrix.ghc }} on ${{ matrix.os }}"
8+
runs-on: ${{ matrix.os }}
89
strategy:
910
matrix:
10-
ghc: ['8.10.1', '8.8.3', '8.6.5', '8.4.4', '8.2.2', '8.0.2']
11-
cabal: ['3.0']
12-
os: [ubuntu-latest]
13-
14-
runs-on: ${{ matrix.os }}
15-
16-
11+
ghc: ['8.10', '9.0', '9.2']
12+
os: [ubuntu-latest, windows-latest, macos-latest]
1713
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-haskell@v1
14+
- name: Checkout base repo
15+
uses: actions/[email protected]
16+
- name: Set up Haskell
17+
id: setup-haskell
18+
uses: haskell/actions/setup@v1
2019
with:
2120
ghc-version: ${{ matrix.ghc }}
22-
cabal-version: ${{ matrix.cabal }}
23-
24-
- uses: actions/cache@v1
25-
name: Cache ~/.cabal/packages
26-
with:
27-
path: ~/.cabal/packages
28-
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-packages
29-
- uses: actions/cache@v1
30-
name: Cache ~/.cabal/store
21+
cabal-version: 'latest'
22+
- name: Configure
23+
run: cabal new-configure
24+
- name: Freeze
25+
run: cabal freeze
26+
- name: Cache
27+
uses: actions/[email protected]
3128
with:
32-
path: ~/.cabal/store
33-
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-store
34-
- uses: actions/cache@v1
35-
name: Cache dist-newstyle
36-
with:
37-
path: dist-newstyle
38-
key: ${{ runner.os }}-${{ matrix.ghc }}-dist-newstyle
39-
40-
- name: Install dependencies
41-
run: |
42-
cabal update
43-
cabal build --only-dependencies --enable-tests --enable-benchmarks
44-
29+
path: ${{ steps.setup-haskell.outputs.cabal-store }}
30+
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
31+
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
4532
- name: Build
46-
run: cabal build --enable-tests --enable-benchmarks all
47-
33+
run: cabal build
4834
stack:
49-
35+
name: "Stack: ${{ matrix.resolver }} on ${{ matrix.os }}"
36+
runs-on: ${{ matrix.os }}
5037
strategy:
5138
matrix:
52-
os: [ubuntu-latest]
53-
stack-args: ['']
54-
55-
runs-on: ${{ matrix.os }}
56-
39+
os: [ubuntu-latest, windows-latest, macos-latest]
40+
resolver: ['lts-18.22', 'nightly-2022-01-20']
5741
steps:
58-
- uses: actions/checkout@v2
59-
- uses: actions/setup-haskell@v1
60-
with:
61-
stack-version: 'latest'
62-
63-
- name: Cache stack global package db
64-
id: stack-global
65-
uses: actions/cache@v1
66-
with:
67-
path: ~/.stack
68-
key: ${{ runner.os }}-stack-global-${{ matrix.stack-args }}-${{ hashFiles('**.yaml') }}
69-
restore-keys: |
70-
${{ runner.os }}-stack-global-${{ matrix.stack-args }}
71-
${{ runner.os }}-stack-global
72-
- name: Cache .stack-work
73-
id: stack-work
74-
uses: actions/cache@v1
42+
- name: Checkout base repo
43+
uses: actions/[email protected]
44+
- name: Set up Haskell
45+
id: setup-haskell
46+
uses: haskell/actions/setup@v1
47+
with:
48+
stack-version: 'latest'
49+
- name: Cache Stack global package DB
50+
uses: actions/[email protected]
51+
with:
52+
path: ~/.stack
53+
key: ${{ runner.os }}-stack-global-${{ matrix.resolver }}-${{ hashFiles('**.yaml') }}
54+
restore-keys: ${{ runner.os }}-stack-global-${{ matrix.resolver }}
55+
- name: Cache .stack-work
56+
uses: actions/[email protected]
57+
with:
58+
path: .stack-work
59+
key: ${{ runner.os }}-stack-work-${{ matrix.resolver}}-${{ hashFiles('**.yaml') }}
60+
restore-keys: ${{ runner.os }}-stack-work-${{ matrix.resolver }}
61+
# https://github.com/commercialhaskell/stack/issues/5405
62+
- name: Clear setup-exe-cache directory
63+
if: runner.os == 'macOS'
64+
continue-on-error: true
65+
run: rm -r ~/.stack/setup-exe-cache
66+
- name: Build
67+
run: stack build --resolver=${{ matrix.resolver }}
68+
nix:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: cachix/install-nix-action@v12
7572
with:
76-
path: .stack-work
77-
key: ${{ runner.os }}-stack-work-${{ matrix.stack-args }}-${{ hashFiles('**.yaml') }}
78-
restore-keys: |
79-
${{ runner.os }}-stack-work-${{ matrix.stack-args }}
80-
${{ runner.os }}-stack-work
81-
82-
- name: Install dependencies
83-
run: |
84-
stack build --test --bench --only-dependencies $ARGS
85-
env:
86-
ARGS: ${{ matrix.args }}
87-
88-
- name: Build
89-
run: |
90-
stack build $ARGS
91-
env:
92-
ARGS: ${{ matrix.args }}
73+
nix_path: nixpkgs=channel:nixos-unstable
74+
- uses: actions/checkout@v2
75+
- run: nix-build
76+
- run: nix-build release.nix -A tarball
77+
- run: nix-build release.nix -A sdistTest
78+
- run: nix-build release.nix -A docs

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build:
10+
name: Create Release
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: cachix/install-nix-action@v12
14+
with:
15+
nix_path: nixpkgs=channel:nixos-unstable
16+
- uses: actions/checkout@v2
17+
18+
- name: Build project
19+
run: |
20+
mkdir assets
21+
nix-build ./release.nix -A sdistTest --no-out-link
22+
ln -s "$(nix-build release.nix -A tarball --no-out-link)"/*.tar.gz assets/
23+
ln -s "$(nix-build release.nix -A docs --no-out-link)"/*.tar.gz assets/
24+
ref="${{ github.ref }}"
25+
printf "Release ${ref#"refs/tags/"}\n\n" >release-note.md
26+
# Get the section after the WIP section
27+
awk '/## WIP/{flag=0;next};/##/{flag=flag+1};flag==1' <changelog.md |
28+
sed "/^##/d" >>"release-note.md"
29+
30+
- name: Create Release
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: |
34+
if [ -f release-note.md ]; then
35+
hub release create \
36+
$(find assets -type f -o -type l -printf "--attach %p ") \
37+
--file release-note.md \
38+
${{ github.ref }}
39+
fi

.github/workflows/tag-release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Tag Latest Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
update:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: cachix/install-nix-action@v12
13+
with:
14+
nix_path: nixpkgs=channel:nixos-unstable
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0 # Fetch everything
18+
ssh-key: ${{ secrets.DEPLOY_KEY }}
19+
- uses: expipiplus1/tag-latest-release/tag-latest-release@HEAD
20+
with:
21+
tagsAndFiles: v vector-sized.cabal

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.ghc.environment.*
2-
cabal.project.local
2+
cabal.project.local*
33
dist
44
dist-*
55
cabal-dev
@@ -19,3 +19,4 @@ cabal.sandbox.config
1919
.stack-work/
2020
.nvimrc
2121
.vimrc
22+

changelog.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
# Change Log
22

33
## WIP
4+
- Drop support for GHC older than 8.10
5+
6+
## [1.5.0] - 2021-08-25
7+
8+
- Change indexes used by `accum` from `Int` to `Finite`.
9+
10+
## [1.4.4] - 2021-06-26
11+
12+
- Add `ix'`
13+
14+
## [1.4.3.1] - 2020-12-13
15+
16+
- Fix Bits instance, shiftl and shiftr were incorrect
17+
18+
## [1.4.3] - 2020-12-08
19+
20+
- Add Primitive flavour of sized vectors
21+
- Add `instance Bits (v a) => Bits (Vector v n a)`
22+
23+
Thanks to @Bodigrim and @mstksg
24+
25+
## [1.4.2] - 2020-08-20
426

527
- Add `instance Unbox a, KnownNat n) => Unbox (Vector n a)`
28+
- Add `zipVectorsUnsafe`
629

730
## [1.4.1.0] - 2020-05-04
831

default.nix

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,12 @@
1-
{ pkgs ? import <nixpkgs> {}
2-
, compiler ? "ghc882"
3-
, hoogle ? true
4-
}:
5-
6-
let src = pkgs.nix-gitignore.gitignoreSource [] ./.;
7-
8-
# Any overrides we require to the specified haskell package set
9-
haskellPackages = with pkgs.haskell.lib;
10-
pkgs.haskell.packages.${compiler}.override {
11-
overrides = self: super: {
12-
} // pkgs.lib.optionalAttrs hoogle {
13-
ghc = super.ghc // { withPackages = super.ghc.withHoogle; };
14-
ghcWithPackages = self.ghc.withPackages;
15-
};
16-
};
17-
18-
# Any packages to appear in the environment provisioned by nix-shell
19-
extraEnvPackages = with haskellPackages; [
20-
];
21-
22-
# Generate a haskell derivation using the cabal2nix tool on `package.yaml`
23-
drv = haskellPackages.callCabal2nix "" src {};
24-
25-
# Insert the extra environment packages into the environment generated by
26-
# cabal2nix
27-
envWithExtras = pkgs.lib.overrideDerivation drv.env (attrs: {
28-
buildInputs = attrs.buildInputs ++ extraEnvPackages;
29-
} // pkgs.lib.optionalAttrs hoogle {
30-
shellHook = attrs.shellHook + ''
31-
export HIE_HOOGLE_DATABASE="$(cat $(which hoogle) | sed -n -e 's|.*--database \(.*\.hoo\).*|\1|p')"
32-
'';
33-
});
34-
35-
in
36-
drv // { env = envWithExtras; }
1+
{ nixpkgsSrc ? <nixpkgs>, pkgs ? import nixpkgsSrc { }, compiler ? null }:
2+
3+
let
4+
haskellPackages = if compiler == null then
5+
pkgs.haskellPackages
6+
else
7+
pkgs.haskell.packages.${compiler};
8+
9+
in haskellPackages.developPackage {
10+
name = "";
11+
root = pkgs.nix-gitignore.gitignoreSource [ ] ./.;
12+
}

package.yaml

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

release.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{ pkgs ? import <nixpkgs> { }, compiler ? null }:
2+
3+
with pkgs.haskell.lib;
4+
5+
let drv = import ./default.nix { inherit pkgs compiler; };
6+
in {
7+
tarball = sdistTarball drv;
8+
docs = documentationTarball drv;
9+
sdistTest = buildFromSdist drv;
10+
}

shell.nix

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

0 commit comments

Comments
 (0)