diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..b554b25 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,47 @@ +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Native dependencies + run: sudo apt install libgmp-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev + - uses: "actions/checkout@v3" + - id: setup-haskell-cabal + uses: "haskell/actions/setup@v2" + with: + cabal-version: "${{ matrix.cabal }}" + enable-stack: false + ghc-version: "${{ matrix.ghc }}" + - name: Update Hackage repository + run: cabal update + - name: cabal.project.local.ci + run: | + if [ -e cabal.project.local.ci ]; then + cp cabal.project.local.ci cabal.project.local + fi + - name: freeze + run: cabal freeze + - uses: "actions/cache@v3" + with: + key: "${{ runner.os }}-${{ matrix.ghc }}-cabal-${{ hashFiles('cabal.project.freeze') }}" + path: | + ${{ steps.setup-haskell-cabal.outputs.cabal-store }} + dist-newstyle + - name: Install dependencies + run: cabal build all --enable-tests --enable-benchmarks --only-dependencies + - name: build all + run: cabal build all --enable-tests --enable-benchmarks + - name: test all + run: cabal test all --enable-tests + - name: haddock all + run: cabal haddock all + strategy: + matrix: + cabal: + - '3.4' + ghc: + - '9.0.2' + - '8.10.7' +name: Haskell CI +on: + - push + - pull_request diff --git a/README.md b/README.md index bf0e128..8a4d271 100644 --- a/README.md +++ b/README.md @@ -137,4 +137,4 @@ to use composable `Animation` wrapper similar to ### `demoLetterI` with smoothed normals -[![smoothed demo letter](./img/i_smoothed_thumb.png)](https://raw.githubusercontent.com/sorki/implicitpipe/master/img/i_smoothed_thumb.png) +[![smoothed demo letter](./img/i_smoothed_thumb.png)](https://raw.githubusercontent.com/sorki/implicitpipe/master/img/i_smoothed.png) diff --git a/cabal.project.local.ci b/cabal.project.local.ci new file mode 100644 index 0000000..7ad7366 --- /dev/null +++ b/cabal.project.local.ci @@ -0,0 +1,24 @@ +-- NOTE: having implicit listed here breaks hint +-- see https://github.com/Haskell-Things/implicitpipe/issues/2 +-- but it is required for CI now +-- until 0.4 +source-repository-package + type: git + location: https://github.com/Haskell-Things/ImplicitCAD + tag: ae794b901e9677593815fad741d87ff56846562d + +-- fork due to resizeBuffer PR https://github.com/tobbebex/GPipe-Core/pull/76 +source-repository-package + type: git + location: https://github.com/sorki/GPipe-Core + tag: 86a7b29014e7ebfb24ac17d5afcd877a38a1fbd5 + subdir: + GPipe-Core + +-- until next release +source-repository-package + type: git + location: https://github.com/plredmond/GPipe-GLFW + tag: 3d7e91a20a80fe31e910884b151ebe4d26e8274e + subdir: + GPipe-GLFW diff --git a/ci.dhall b/ci.dhall new file mode 100644 index 0000000..3593ec0 --- /dev/null +++ b/ci.dhall @@ -0,0 +1,18 @@ +let haskellCi = + https://raw.githubusercontent.com/sorki/github-actions-dhall/pending/haskell-ci.dhall + +in haskellCi.generalCi + ( [ haskellCi.BuildStep.Name + { name = "Native dependencies" + , run = + "sudo apt install libgmp-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev" + } + ] + # haskellCi.matrixSteps + ) + ( Some + { ghc = [ haskellCi.GHC.GHC902, haskellCi.GHC.GHC8107 ] + , cabal = [ haskellCi.Cabal.Cabal34 ] + } + ) + : haskellCi.CI.Type diff --git a/ci.sh b/ci.sh new file mode 100755 index 0000000..7d7cc86 --- /dev/null +++ b/ci.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +# Script by @fisx + +set -eo pipefail +cd "$( dirname "${BASH_SOURCE[0]}" )" + +echo "regenerating .github/workflows/ci.yaml..." + +mkdir -p .github/workflows + +# based on https://github.com/vmchale/github-actions-dhall +which dhall-to-yaml || cabal install dhall-yaml +dhall-to-yaml --file ci.dhall > .github/workflows/ci.yaml diff --git a/default.nix b/default.nix index 968061e..d474d65 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,11 @@ -{ pkgs ? import { overlays = [ (import ./overlay.nix) ]; }}: +{ rev ? "c542baa0c894796c92a8173dead027f3b952c22e" +, overlays ? [ (import ./overlay.nix) ] +, pkgs ? + if ((rev == "") || (rev == "default") || (rev == "local")) + then import { inherit overlays; } + # Do not guard with hash, so the project is able to use current channels (rolling `rev`) of Nixpkgs + else import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz") { inherit overlays; } +}: let src = pkgs.nix-gitignore.gitignoreSource [ ] ./.; diff --git a/example-haskell/SomeModule.hs b/example-haskell/SomeModule.hs index 334973c..8784009 100644 --- a/example-haskell/SomeModule.hs +++ b/example-haskell/SomeModule.hs @@ -9,10 +9,10 @@ import SomeOtherModule res = 2 obj = union $ [ - cubeR 0 False (V3 20 20 14) + cube False (V3 20 20 14) , translate (V3 20 20 20) (sphere 15) , translate (V3 30 20 20) (sphere 5) - , translate (V3 0 0 25) (cubeR 2 False (pure 10)) + , translate (V3 0 0 25) (withRounding 2 $ cube False (pure 10)) , translate (V3 25 0 0) (cylinder2 10 4 10) , translate (V3 (-25) 0 0) obj' ] diff --git a/overlay.nix b/overlay.nix index d195c5d..106cfab 100644 --- a/overlay.nix +++ b/overlay.nix @@ -13,8 +13,8 @@ let gpipeGlfwSrc = super.fetchFromGitHub { owner = "plredmond"; repo = "GPipe-GLFW"; - rev = "83d26eb7b41d67f5ac6fbd1bd8758d72c660e039"; - sha256 = "0fg60amvp2v37cwmvfa0n7if1ppisjjh3bknmrr17m7fbfbbxlhq"; + rev = "3d7e91a20a80fe31e910884b151ebe4d26e8274e"; + sha256 = "0rx00mxlz6jlipx19h271mbnp8l9kzgm3dhwprwww4gf8g43r7vd"; }; in ({ @@ -25,12 +25,12 @@ in GPipe = hsuper.callCabal2nix "GPipe" "${gpipeSrc}/GPipe-Core" {}; GPipe-GLFW = hsuper.callCabal2nix "GPipe-GLFW" ("${gpipeGlfwSrc}/GPipe-GLFW") {}; - # until > 3.0.2 is out + # until > 4.0.0 is out implicit = hsuper.callCabal2nix "implicit" (super.fetchFromGitHub { - owner = "colah"; + owner = "Haskell-Things"; repo = "ImplicitCAD"; - rev = "8dff5531cdc4d9ed32bf958e3945b4a3a0ef3774"; - sha256 = "0bp797a9wlpyw2d6b4csz5ikqq3wy1qry0iabl7r7axjrhvnfp56"; + rev = "ae794b901e9677593815fad741d87ff56846562d"; + sha256 = "0q8bj3jysgl7kfivrag8g6yx58n5rxf69qsc3lw43941lamaxpda"; }) {}; }); }); diff --git a/src/Graphics/Implicit/Viewer/Loaders.hs b/src/Graphics/Implicit/Viewer/Loaders.hs index efe2eb7..f935524 100644 --- a/src/Graphics/Implicit/Viewer/Loaders.hs +++ b/src/Graphics/Implicit/Viewer/Loaders.hs @@ -16,7 +16,6 @@ import Data.List (isSuffixOf) import Data.Time (getCurrentTime, diffUTCTime) import Data.Typeable (Typeable) -import Linear (V3(V3)) import Graphics.Implicit import Graphics.Implicit.Primitives (getBox) import Graphics.Implicit.ExtOpenScad.Definitions diff --git a/stack.yaml b/stack.yaml index d643536..3027352 100644 --- a/stack.yaml +++ b/stack.yaml @@ -2,7 +2,7 @@ # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) -resolver: lts-16.25 +resolver: lts-19.5 # Local packages, usually specified by relative directory name packages: @@ -10,19 +10,16 @@ packages: # Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3) extra-deps: -- storable-endian-0.2.6 -- quickspec-2.1.5@sha256:1d1cc020fa9075cb5fafd4056fe1d930d5763b954fa8200e57ce6aba057544b2,3557 -- twee-lib-2.2@sha256:9fe9327505d8f450a94f2fc9eea74b292901b7992d520aa1dd4f0410fbe0e594,2112 - git: git@github.com:sorki/GPipe-Core commit: 86a7b29014e7ebfb24ac17d5afcd877a38a1fbd5 subdirs: - GPipe-Core - git: git@github.com:plredmond/GPipe-GLFW - commit: 83d26eb7b41d67f5ac6fbd1bd8758d72c660e039 + commit: 3d7e91a20a80fe31e910884b151ebe4d26e8274e subdirs: - GPipe-GLFW -- git: git@github.com:colah/ImplicitCAD - commit: 8dff5531cdc4d9ed32bf958e3945b4a3a0ef3774 +- git: git@github.com:Haskell-Things/ImplicitCAD + commit: ae794b901e9677593815fad741d87ff56846562d # Override default flag values for local packages and extra-deps flags: {}