-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to build with more-modern systems. There's no functional change here.
- Loading branch information
Showing
6 changed files
with
159 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,49 +17,45 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
os: [ubuntu-latest] | ||
cabal: ["latest"] | ||
ghc: | ||
# - "8.6.5" | ||
- "8.8.3" | ||
- "8.10.4" | ||
- "9.0.1" | ||
exclude: | ||
- os: macOS-latest | ||
ghc: 9.0.1 | ||
- "8.10" | ||
- "9.6" | ||
- "9.10" | ||
|
||
include: | ||
- os: macOS-latest | ||
ghc: 8.8.3 | ||
#- os: macOS-latest | ||
# ghc: 8.6.5 | ||
- os: windows-latest | ||
ghc: 9.0.1 | ||
ghc: 9.6 | ||
- os: windows-latest | ||
ghc: 8.8.3 | ||
ghc: 9.6 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main' | ||
|
||
- uses: haskell/actions/setup@v1 | ||
- uses: haskell-actions/setup@v2 | ||
id: setup-haskell-cabal | ||
name: Setup Haskell | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
cabal-version: ${{ matrix.cabal }} | ||
cabal-update: true | ||
|
||
- name: Configure | ||
run: | | ||
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct | ||
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct # although we have no tests | ||
|
||
- name: Freeze | ||
run: | | ||
cabal freeze | ||
|
||
- uses: actions/[email protected] | ||
name: Cache ~/.cabal/store | ||
with: | ||
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | ||
# drop the cache for now | ||
#- uses: actions/[email protected] | ||
# name: Cache ~/.cabal/store | ||
# with: | ||
# path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | ||
# key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
|
@@ -81,17 +77,18 @@ jobs: | |
- uses: actions/checkout@v2 | ||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main' | ||
|
||
- uses: haskell/actions/setup@v1 | ||
- uses: haskell-actions/setup@v2 | ||
name: Setup Haskell Stack | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
stack-version: ${{ matrix.stack }} | ||
|
||
- uses: actions/[email protected] | ||
name: Cache ~/.stack | ||
with: | ||
path: ~/.stack | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-stack | ||
# drop the cache for now | ||
#- uses: actions/[email protected] | ||
# name: Cache ~/.stack | ||
# with: | ||
# path: ~/.stack | ||
# key: ${{ runner.os }}-${{ matrix.ghc }}-stack | ||
|
||
- name: Install dependencies | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
# inspired by: https://serokell.io/blog/practical-nix-flakes#packaging-existing-applications | ||
description = "view Vega/Vega-Lite visualizations in a web browser"; | ||
|
||
inputs = { | ||
nixpkgs.url = "nixpkgs"; | ||
}; | ||
|
||
outputs = { self, nixpkgs }: | ||
let | ||
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ]; | ||
# supportedSystems = [ "x86_64-linux" ]; | ||
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system); | ||
nixpkgsFor = forAllSystems (system: import nixpkgs { | ||
inherit system; | ||
overlays = [ self.overlay ]; | ||
}); | ||
in | ||
{ | ||
overlay = (final: prev: { | ||
vega-view = final.haskellPackages.callCabal2nix "vega-view" ./. {}; | ||
}); | ||
packages = forAllSystems (system: { | ||
vega-view = nixpkgsFor.${system}.vega-view; | ||
}); | ||
defaultPackage = forAllSystems (system: self.packages.${system}.vega-view); | ||
checks = self.packages; | ||
devShell = forAllSystems (system: let haskellPackages = nixpkgsFor.${system}.haskellPackages; | ||
in haskellPackages.shellFor { | ||
packages = p: [self.packages.${system}.vega-view]; | ||
withHoogle = true; | ||
buildInputs = with haskellPackages; [ | ||
haskell-language-server | ||
hlint | ||
cabal-install | ||
]; | ||
# Change the prompt to show that you are in a devShell | ||
shellHook = '' | ||
echo -e "*** \e[1;32mWelcome to vega-view development\e[0m ***" | ||
ghc --version | ||
cabal --version | ||
hlint --version | ||
echo -e "" | ||
export PS1='vega-view:\A \e[1;34m\w\e[0m ' | ||
''; | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
resolver: lts-18.13 | ||
resolver: lts-22.24 | ||
|
||
packages: | ||
- . | ||
|
||
extra-deps: | ||
- aeson-2.0.1.0 | ||
- semialign-1.2 | ||
- time-compat-1.9.6.1 | ||
- hashable-1.3.4.1 | ||
- scotty-0.12 | ||
#extra-deps: | ||
#- aeson-2.1.2.1 | ||
#- semialign-1.2 | ||
#- time-compat-1.9.6.1 | ||
#- hashable-1.3.4.1 | ||
#- scotty-0.12 |