Skip to content

Commit

Permalink
Merge pull request #23 from w0rm/nix
Browse files Browse the repository at this point in the history
Use nix
  • Loading branch information
w0rm authored Mar 24, 2024
2 parents 2d44d72 + 29b5c0e commit 7ed3939
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 81 deletions.
32 changes: 9 additions & 23 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,19 @@ jobs:
gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- run: git config --global user.name "Andrey Kuzmin"
- run: git config --global user.email "unsoundscapes@gmail.com"

- uses: actions/setup-node@v1
with:
node-version: "12"
- run: git config --global user.email "hi@unsoundscapes.com"

- 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 elm@latest-0.19.1 elm-test@0.19.1-revision6 elm-review@2.5.0 elm-format@0.8.5

- 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

- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: gh-pages
ref: gh-pages
- run: ./scripts/gh-pages.sh
- run: nix develop --command ./scripts/gh-pages.sh
33 changes: 10 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,21 @@ jobs:
test-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- run: git config --global user.name "Andrey Kuzmin"
- run: git config --global user.email "unsoundscapes@gmail.com"

- uses: actions/setup-node@v1
with:
node-version: "12"
- run: git config --global user.email "hi@unsoundscapes.com"

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

- run: npm install -g elm@latest-0.19.1 elm-test@0.19.1-revision6 elm-review@2.5.0 elm-format@0.8.5

- 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

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

- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
path: gh-pages
ref: gh-pages
- run: ./scripts/gh-pages.sh ${{ github.event.inputs.version }}
- run: nix develop --command ./scripts/gh-pages.sh ${{ github.event.inputs.version }}
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 elm@latest-0.19.1 elm-test@0.19.1-revision6 elm-review@2.5.0 elm-format@0.8.5

- 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 @@ -17,6 +17,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"
}
}
1 change: 0 additions & 1 deletion examples/src/Tubes.elm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Axis3d
import BoundingBox3d exposing (BoundingBox3d)
import Browser
import Camera3d
import Circle2d exposing (boundingBox)
import Color
import Direction3d
import File.Download
Expand Down
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
];
};
});
}
15 changes: 8 additions & 7 deletions review/elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +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-performance": "1.0.0",
"jfmengels/elm-review-unused": "1.1.9",
"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: 2 additions & 0 deletions review/src/ReviewConfig.elm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import NoUnused.Parameters
import NoUnused.Patterns
import NoUnused.Variables
import Review.Rule exposing (Rule)
import Simplify


config : List Rule
Expand All @@ -38,5 +39,6 @@ config =
, NoUnused.Parameters.rule
, NoUnused.Patterns.rule
, NoUnused.Variables.rule
, Simplify.rule (Simplify.expectNaN Simplify.defaults)
, NoUnoptimizedRecursion.rule (NoUnoptimizedRecursion.optOutWithComment "IGNORE TCO")
]
2 changes: 1 addition & 1 deletion src/Obj/Decode.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ decodeHelp units decode lines lineno positions normals uvs groups object_ materi
[] ->
formatError lineno "No material name"

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

Expand Down
1 change: 0 additions & 1 deletion src/Obj/Encode.elm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module Obj.Encode exposing
import Array exposing (Array)
import Dict exposing (Dict)
import Length exposing (Length, Meters)
import Obj.Decode exposing (object)
import Point3d exposing (Point3d)
import Polyline3d exposing (Polyline3d)
import Quantity exposing (Unitless)
Expand Down
8 changes: 4 additions & 4 deletions tests/Encoding.elm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ triangles =
\_ ->
Encode.encode Length.inMeters
(Encode.triangles
(TriangularMesh.indexed (Array.fromList []) [ ( 1, 2, 3 ) ])
(TriangularMesh.indexed Array.empty [ ( 1, 2, 3 ) ])
)
|> Expect.equal ""
, Test.test "skips empty indices" <|
Expand Down Expand Up @@ -80,7 +80,7 @@ faces =
, Test.test "skips empty vertices" <|
\_ ->
Encode.encode Length.inMeters
(Encode.faces (TriangularMesh.indexed (Array.fromList []) [ ( 1, 2, 3 ) ]))
(Encode.faces (TriangularMesh.indexed Array.empty [ ( 1, 2, 3 ) ]))
|> Expect.equal ""
, Test.test "skips empty indices" <|
\_ ->
Expand Down Expand Up @@ -124,7 +124,7 @@ texturedTriangles =
, Test.test "skips empty vertices" <|
\_ ->
Encode.encode Length.inMeters
(Encode.texturedTriangles (TriangularMesh.indexed (Array.fromList []) [ ( 1, 2, 3 ) ]))
(Encode.texturedTriangles (TriangularMesh.indexed Array.empty [ ( 1, 2, 3 ) ]))
|> Expect.equal ""
, Test.test "skips empty indices" <|
\_ ->
Expand Down Expand Up @@ -172,7 +172,7 @@ texturedFaces =
, Test.test "skips empty vertices" <|
\_ ->
Encode.encode Length.inMeters
(Encode.texturedFaces (TriangularMesh.indexed (Array.fromList []) [ ( 1, 2, 3 ) ]))
(Encode.texturedFaces (TriangularMesh.indexed Array.empty [ ( 1, 2, 3 ) ]))
|> Expect.equal ""
, Test.test "skips empty indices" <|
\_ ->
Expand Down

0 comments on commit 7ed3939

Please sign in to comment.