lint and lift test phony

This commit is contained in:
Brian Hicks 2020-10-28 23:58:47 -05:00
parent 096e6ea3da
commit 8f2614f380

View File

@ -28,6 +28,17 @@ main =
removeFilesAfter "public" ["//*"] removeFilesAfter "public" ["//*"]
removeFilesAfter "styleguide-app" ["elm.js", "bundle.js", "elm-stuff"] removeFilesAfter "styleguide-app" ["elm.js", "bundle.js", "elm-stuff"]
phony "test" $ do
need
[ "log/npm-install.txt",
"tests/elm-verify-examples.json",
"log/elm-verify-examples.txt",
"log/elm-test.txt",
"log/axe-report.txt",
"log/percy-tests.txt",
"log/deprecated-imports-report.txt"
]
-- things that should be kept under version control -- things that should be kept under version control
"tests/elm-verify-examples.json" %> \out -> do "tests/elm-verify-examples.json" %> \out -> do
need ["elm.json"] need ["elm.json"]
@ -40,6 +51,20 @@ main =
cmd_ "script/deprecated-imports.py" "--imports-file" out "update" cmd_ "script/deprecated-imports.py" "--imports-file" out "update"
-- temporary files, used to produce CI reports -- temporary files, used to produce CI reports
"log/elm-test.txt" %> \out -> do
elmFiles <- getDirectoryFiles "." ["tests/**/*.elm"]
-- I'm not sure why elm-test needs package.json, but fsatracing it
-- reveals the dep, so in it goes!
need (["package.json", "elm.json"] ++ elmFiles)
Stdout report <- cmd "elm-test"
writeFileChanged out report
"log/elm-verify-examples.txt" %> \out -> do
elmFiles <- getDirectoryFiles "." ["src/**/*.elm"]
need (["tests/elm-verify-examples.json"] ++ elmFiles)
Stdout report <- cmd "elm-verify-examples"
writeFileChanged out report
"log/format.txt" %> \out -> do "log/format.txt" %> \out -> do
let placesToLook = ["src", "tests", "styleguide-app"] let placesToLook = ["src", "tests", "styleguide-app"]
elmFiles <- getDirectoryFiles "." (map (\place -> place </> "**" </> "*.elm") placesToLook) elmFiles <- getDirectoryFiles "." (map (\place -> place </> "**" </> "*.elm") placesToLook)
@ -126,12 +151,6 @@ main =
-- the dependencies are actually tracked and satisfied, they'll move above -- the dependencies are actually tracked and satisfied, they'll move above
-- this line. -- this line.
phony "test" $ do
need ["log/node_modules.txt", "tests/elm-verify-examples.json"]
cmd_ "npx" "elm-verify-examples"
cmd_ "npx" "elm-test"
need ["log/axe-report.txt", "log/percy-tests.txt", "log/deprecated-imports-report.txt"]
phony "ci" $ do phony "ci" $ do
need ["log/check-exposed.txt", "test", "log/format.txt", "log/documentation.json", "public"] need ["log/check-exposed.txt", "test", "log/format.txt", "log/documentation.json", "public"]