Skip to content

Commit 7ed3939

Browse files
authored
Merge pull request #23 from w0rm/nix
Use nix
2 parents 2d44d72 + 29b5c0e commit 7ed3939

File tree

12 files changed

+124
-81
lines changed

12 files changed

+124
-81
lines changed

.github/workflows/gh-pages.yml

+9-23
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,19 @@ jobs:
88
gh-pages:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
1311
- run: git config --global user.name "Andrey Kuzmin"
14-
- run: git config --global user.email "[email protected]"
15-
16-
- uses: actions/setup-node@v1
17-
with:
18-
node-version: "12"
12+
- run: git config --global user.email "[email protected]"
1913

20-
- uses: actions/cache@v2
14+
- uses: actions/checkout@v3
15+
- uses: cachix/install-nix-action@v22
2116
with:
22-
path: |
23-
~/.npm
24-
~/.elm
25-
elm-stuff
26-
key: ${{ runner.os }}-cache
27-
28-
29-
30-
- run: elm-format --validate .
31-
32-
- run: elm-review
33-
34-
- run: elm-test
17+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
18+
- run: nix develop --command elm-format --validate .
19+
- run: nix develop --command elm-review
20+
- run: nix develop --command elm-test
3521

36-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
3723
with:
3824
path: gh-pages
3925
ref: gh-pages
40-
- run: ./scripts/gh-pages.sh
26+
- run: nix develop --command ./scripts/gh-pages.sh

.github/workflows/publish.yml

+10-23
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,21 @@ jobs:
1212
test-and-publish:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
16-
1715
- run: git config --global user.name "Andrey Kuzmin"
18-
- run: git config --global user.email "[email protected]"
19-
20-
- uses: actions/setup-node@v1
21-
with:
22-
node-version: "12"
16+
- run: git config --global user.email "[email protected]"
2317

24-
- uses: actions/cache@v2
18+
- uses: actions/checkout@v3
19+
- uses: cachix/install-nix-action@v22
2520
with:
26-
path: |
27-
~/.npm
28-
~/.elm
29-
key: ${{ runner.os }}-cache
30-
31-
32-
33-
- run: elm-format --validate .
34-
35-
- run: elm-review
36-
37-
- run: elm-test
21+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
22+
- run: nix develop --command elm-format --validate .
23+
- run: nix develop --command elm-review
24+
- run: nix develop --command elm-test
3825

39-
- run: ./scripts/elm-publish.sh ${{ github.event.inputs.version }}
26+
- run: nix develop --command ./scripts/elm-publish.sh ${{ github.event.inputs.version }}
4027

41-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
4229
with:
4330
path: gh-pages
4431
ref: gh-pages
45-
- run: ./scripts/gh-pages.sh ${{ github.event.inputs.version }}
32+
- run: nix develop --command ./scripts/gh-pages.sh ${{ github.event.inputs.version }}

.github/workflows/test.yml

+6-20
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,10 @@ jobs:
88
elm-test:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
13-
- uses: actions/setup-node@v1
14-
with:
15-
node-version: "12"
16-
17-
- uses: actions/cache@v2
11+
- uses: actions/checkout@v3
12+
- uses: cachix/install-nix-action@v22
1813
with:
19-
path: |
20-
~/.npm
21-
~/.elm
22-
elm-stuff
23-
key: ${{ runner.os }}-cache
24-
25-
26-
27-
- run: elm-format --validate .
28-
29-
- run: elm-review
30-
31-
- run: elm-test
14+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
15+
- run: nix develop --command elm-format --validate .
16+
- run: nix develop --command elm-review
17+
- run: nix develop --command elm-test

elm.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"ianmackenzie/elm-units": "2.7.0 <= v < 3.0.0"
1818
},
1919
"test-dependencies": {
20-
"elm-explorations/test": "1.2.2 <= v < 2.0.0"
20+
"elm-explorations/test": "2.2.0 <= v < 3.0.0"
2121
}
2222
}

examples/src/Tubes.elm

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import Axis3d
1010
import BoundingBox3d exposing (BoundingBox3d)
1111
import Browser
1212
import Camera3d
13-
import Circle2d exposing (boundingBox)
1413
import Color
1514
import Direction3d
1615
import File.Download

flake.lock

+61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
};
6+
7+
outputs = { self, nixpkgs, flake-utils }:
8+
flake-utils.lib.eachDefaultSystem (system:
9+
let pkgs = nixpkgs.legacyPackages.${system};
10+
in
11+
{
12+
devShells.default = with pkgs; with elmPackages; mkShell {
13+
buildInputs = [
14+
elm
15+
elm-format
16+
elm-test
17+
elm-review
18+
elm-json
19+
];
20+
};
21+
});
22+
}

review/elm.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@
99
"elm/core": "1.0.5",
1010
"elm/json": "1.1.3",
1111
"elm/project-metadata-utils": "1.0.1",
12-
"jfmengels/elm-review": "2.4.1",
13-
"jfmengels/elm-review-performance": "1.0.0",
14-
"jfmengels/elm-review-unused": "1.1.9",
15-
"stil4m/elm-syntax": "7.2.2"
12+
"jfmengels/elm-review": "2.13.1",
13+
"jfmengels/elm-review-simplify": "2.1.3",
14+
"jfmengels/elm-review-unused": "1.2.0",
15+
"jfmengels/elm-review-performance": "1.0.2",
16+
"stil4m/elm-syntax": "7.3.2"
1617
},
1718
"indirect": {
1819
"elm/html": "1.0.0",
1920
"elm/parser": "1.1.0",
2021
"elm/random": "1.0.0",
2122
"elm/time": "1.0.0",
2223
"elm/virtual-dom": "1.0.2",
23-
"elm-community/list-extra": "8.3.0",
24-
"elm-explorations/test": "1.2.2",
24+
"elm-community/list-extra": "8.7.0",
25+
"elm-explorations/test": "2.2.0",
2526
"rtfeldman/elm-hex": "1.0.0",
2627
"stil4m/structured-writer": "1.0.3"
2728
}
2829
},
2930
"test-dependencies": {
3031
"direct": {
31-
"elm-explorations/test": "1.2.2"
32+
"elm-explorations/test": "2.2.0"
3233
},
3334
"indirect": {}
3435
}

review/src/ReviewConfig.elm

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import NoUnused.Parameters
2121
import NoUnused.Patterns
2222
import NoUnused.Variables
2323
import Review.Rule exposing (Rule)
24+
import Simplify
2425

2526

2627
config : List Rule
@@ -38,5 +39,6 @@ config =
3839
, NoUnused.Parameters.rule
3940
, NoUnused.Patterns.rule
4041
, NoUnused.Variables.rule
42+
, Simplify.rule (Simplify.expectNaN Simplify.defaults)
4143
, NoUnoptimizedRecursion.rule (NoUnoptimizedRecursion.optOutWithComment "IGNORE TCO")
4244
]

src/Obj/Decode.elm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ decodeHelp units decode lines lineno positions normals uvs groups object_ materi
14021402
[] ->
14031403
formatError lineno "No material name"
14041404

1405-
else if startsWith == "" || String.left 1 startsWith == "#" || List.any ((==) startsWith) skipCommands then
1405+
else if startsWith == "" || String.left 1 startsWith == "#" || List.member startsWith skipCommands then
14061406
-- Skip empty lines, comments and unsupported commands
14071407
decodeHelp units decode remainingLines (lineno + 1) positions normals uvs groups object_ material_ groups_ faceElements lineElements pointsElements
14081408

src/Obj/Encode.elm

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ module Obj.Encode exposing
2828
import Array exposing (Array)
2929
import Dict exposing (Dict)
3030
import Length exposing (Length, Meters)
31-
import Obj.Decode exposing (object)
3231
import Point3d exposing (Point3d)
3332
import Polyline3d exposing (Polyline3d)
3433
import Quantity exposing (Unitless)

tests/Encoding.elm

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ triangles =
4343
\_ ->
4444
Encode.encode Length.inMeters
4545
(Encode.triangles
46-
(TriangularMesh.indexed (Array.fromList []) [ ( 1, 2, 3 ) ])
46+
(TriangularMesh.indexed Array.empty [ ( 1, 2, 3 ) ])
4747
)
4848
|> Expect.equal ""
4949
, Test.test "skips empty indices" <|
@@ -80,7 +80,7 @@ faces =
8080
, Test.test "skips empty vertices" <|
8181
\_ ->
8282
Encode.encode Length.inMeters
83-
(Encode.faces (TriangularMesh.indexed (Array.fromList []) [ ( 1, 2, 3 ) ]))
83+
(Encode.faces (TriangularMesh.indexed Array.empty [ ( 1, 2, 3 ) ]))
8484
|> Expect.equal ""
8585
, Test.test "skips empty indices" <|
8686
\_ ->
@@ -124,7 +124,7 @@ texturedTriangles =
124124
, Test.test "skips empty vertices" <|
125125
\_ ->
126126
Encode.encode Length.inMeters
127-
(Encode.texturedTriangles (TriangularMesh.indexed (Array.fromList []) [ ( 1, 2, 3 ) ]))
127+
(Encode.texturedTriangles (TriangularMesh.indexed Array.empty [ ( 1, 2, 3 ) ]))
128128
|> Expect.equal ""
129129
, Test.test "skips empty indices" <|
130130
\_ ->
@@ -172,7 +172,7 @@ texturedFaces =
172172
, Test.test "skips empty vertices" <|
173173
\_ ->
174174
Encode.encode Length.inMeters
175-
(Encode.texturedFaces (TriangularMesh.indexed (Array.fromList []) [ ( 1, 2, 3 ) ]))
175+
(Encode.texturedFaces (TriangularMesh.indexed Array.empty [ ( 1, 2, 3 ) ]))
176176
|> Expect.equal ""
177177
, Test.test "skips empty indices" <|
178178
\_ ->

0 commit comments

Comments
 (0)