Skip to content

Commit

Permalink
Use nix
Browse files Browse the repository at this point in the history
  • Loading branch information
w0rm committed Mar 23, 2024
1 parent 21d493b commit dd50a4e
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 37 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,10 @@ jobs:
elm-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: "12"

- uses: actions/cache@v2
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
path: |
~/.npm
~/.elm
elm-stuff
key: ${{ runner.os }}-cache

- run: npm install -g [email protected] [email protected] [email protected] [email protected]

- run: elm-format --validate .

- run: elm-review

- run: elm-test
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix develop --command elm-format --validate .
- run: nix develop --command elm-review
- run: nix develop --command elm-test
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"ianmackenzie/elm-units": "2.7.0 <= v < 3.0.0"
},
"test-dependencies": {
"elm-explorations/test": "1.2.2 <= v < 2.0.0"
"elm-explorations/test": "2.2.0 <= v < 3.0.0"
}
}
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = with pkgs; with elmPackages; mkShell {
buildInputs = [
elm
elm-format
elm-test
elm-review
elm-json
];
};
});
}
16 changes: 8 additions & 8 deletions review/elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
"elm/core": "1.0.5",
"elm/json": "1.1.3",
"elm/project-metadata-utils": "1.0.1",
"jfmengels/elm-review": "2.4.1",
"jfmengels/elm-review-simplify": "1.0.1",
"jfmengels/elm-review-unused": "1.1.9",
"jfmengels/elm-review-performance": "1.0.0",
"stil4m/elm-syntax": "7.2.2"
"jfmengels/elm-review": "2.13.1",
"jfmengels/elm-review-simplify": "2.1.3",
"jfmengels/elm-review-unused": "1.2.0",
"jfmengels/elm-review-performance": "1.0.2",
"stil4m/elm-syntax": "7.3.2"
},
"indirect": {
"elm/html": "1.0.0",
"elm/parser": "1.1.0",
"elm/random": "1.0.0",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2",
"elm-community/list-extra": "8.3.0",
"elm-explorations/test": "1.2.2",
"elm-community/list-extra": "8.7.0",
"elm-explorations/test": "2.2.0",
"rtfeldman/elm-hex": "1.0.0",
"stil4m/structured-writer": "1.0.3"
}
},
"test-dependencies": {
"direct": {
"elm-explorations/test": "1.2.2"
"elm-explorations/test": "2.2.0"
},
"indirect": {}
}
Expand Down
2 changes: 1 addition & 1 deletion review/src/ReviewConfig.elm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ config =
, NoUnused.Parameters.rule
, NoUnused.Patterns.rule
, NoUnused.Variables.rule
, Simplify.rule
, Simplify.rule Simplify.defaults
, NoUnoptimizedRecursion.rule (NoUnoptimizedRecursion.optOutWithComment "IGNORE TCO")
]
2 changes: 1 addition & 1 deletion scripts/elm-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ git commit -m "Bump to $version"
git push
last_commit=$(git rev-parse HEAD)

git rm -rf --ignore-unmatch .github benchmarks examples scripts tests elm-physics.gif
git rm -rf --ignore-unmatch .github benchmarks examples scripts tests elm-physics.gif flake.nix
sed -i.bak "s+https://unsoundscapes.com/elm-physics/+https://unsoundscapes.com/elm-physics/$version/+g" README.md
sed -i.bak "s+https://github.com/w0rm/elm-physics/tree/main/+https://github.com/w0rm/elm-physics/tree/$last_commit/+g" README.md
rm README.md.bak
Expand Down
8 changes: 5 additions & 3 deletions src/Shapes/Convex.elm
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,11 @@ initFacesHelp visited vertices faceByEdgeIndex facesToCheck edgesToCheck current
newEdgesToCheck =
List.foldl
(\{ indices } res ->
case indices of
( i1, i2, i3 ) ->
( i2, i1 ) :: ( i3, i2 ) :: ( i1, i3 ) :: res
let
( i1, i2, i3 ) =
indices
in
( i2, i1 ) :: ( i3, i2 ) :: ( i1, i3 ) :: res
)
[]
coplanar
Expand Down
4 changes: 1 addition & 3 deletions tests/Shapes/ConvexTest.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module Shapes.ConvexTest exposing
, volume
)

import Block3d exposing (vertices)
import Expect
import Extra.Expect as Expect
import Fixtures.Convex
Expand Down Expand Up @@ -102,8 +101,7 @@ faces =
(List.map
(\{ normal, vertices } ->
\_ ->
Expect.true
"normal points inside"
Expect.equal True
(List.all
(\v ->
let
Expand Down

0 comments on commit dd50a4e

Please sign in to comment.