flyx / NimYAML

YAML implementation for Nim
https://nimyaml.org
Other
186 stars 36 forks source link

add github action #98

Closed ringabout closed 2 years ago

ringabout commented 3 years ago

hello, @flyx

Some tests are broken on devel.

nim lexerTests shows

/home/runner/.nimble/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/runner/.local/bin:/opt/pipx_bin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
/home/runner/work/NimYAML/NimYAML/yaml/private/lex.nim(136, 6) Hint: 'lineWithMarker' is declared but not used [XDeclaredButNotUsed]
io.nim(866)              writeFile
Error: unhandled exception: cannot open: /home/runner/.cache/nim/tlex_d/test/tlex.json [IOError]

nim r test/tserialization shows

stack trace: (most recent call last)
C:\Users\blue\.choosenim\toolchains\nim-#devel\lib\core\macros.nim(1685, 10) getCustomPragmaVal
C:\Users\blue\Documents\GitHub\NimYAML\test\tserialization.nim(134, 7) template/generic instantiation of `suite` from here
C:\Users\blue\Documents\GitHub\NimYAML\test\tserialization.nim(559, 8) template/generic instantiation of `test` from here
C:\Users\blue\Documents\GitHub\NimYAML\test\tserialization.nim(562, 9) template/generic instantiation of `load` from here
C:\Users\blue\Documents\GitHub\NimYAML\yaml\serialization.nim(1341, 14) template/generic instantiation of `construct` from here
C:\Users\blue\Documents\GitHub\NimYAML\yaml\serialization.nim(1319, 19) template/generic instantiation of `constructChild` from here
C:\Users\blue\Documents\GitHub\NimYAML\yaml\serialization.nim(1166, 18) template/generic instantiation of `constructObject` from here
C:\Users\blue\Documents\GitHub\NimYAML\yaml\serialization.nim(416, 19) template/generic instantiation of `constructChild` from here
C:\Users\blue\Documents\GitHub\NimYAML\yaml\serialization.nim(1145, 20) template/generic instantiation of `constructObject` from here
C:\Users\blue\Documents\GitHub\NimYAML\yaml\serialization.nim(904, 25) template/generic instantiation of `constructObjectDefault` from here   
C:\Users\blue\Documents\GitHub\NimYAML\yaml\serialization.nim(840, 29) template/generic instantiation of `getCustomPragmaVal` from here       
C:\Users\blue\.choosenim\toolchains\nim-#devel\lib\core\macros.nim(1685, 10) Error: O doesn't have any custom pragmas

Ref https://github.com/nim-lang/Nim/issues/18543

ringabout commented 3 years ago

You can see CI result at https://github.com/xflywind/NimYAML

https://github.com/xflywind/NimYAML/runs/3115510007

flyx commented 3 years ago

I am a bit confused. You are describing an issue but this PR does not fix that issue, instead it adds a GitHub action for… some reason? And that GitHub action does only run selected tests, not all of them… What is the goal with this? I first thought you want to reproduce the error, but in your fork the action seems to be successful.

ringabout commented 3 years ago

Yeah, this PR just added the GitHub action. The issues I mentioned are some regressions on Nim devel. After the issues are solved or workarounded, other tests can be enabled.

flyx commented 3 years ago

Does this GitHub action help Nim development in some way? For NimYAML development it should certainly also execute parserTests and quickstartTests so I would add those unless you have a use-case for which that is inconvenient.

ringabout commented 3 years ago

For NimYAML development it should certainly also execute parserTests and quickstartTests

I agree, let me test whether these tests work on stable branch.

For parserTests on 1.4.8 branch

/home/runner/.choosenim/toolchains/nim-1.4.8/lib/pure/collections/tables.nim(423, 3) Warning: Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]
[tparser] Generating tests from "/home/runner/work/NimYAML/NimYAML/test/yaml-test-suite"
/home/runner/work/NimYAML/NimYAML/test/tparser.nim(93, 9) template/generic instantiation of `genTests` from here
/home/runner/work/NimYAML/NimYAML/test/tparser.nim(85, 22) Error: cannot open file: ls: cannot access '/home/runner/work/NimYAML/NimYAML/test/yaml-test-suite/*': No such file or directory/===
flyx commented 3 years ago

That looks like the GitHub action failed to fetch the yaml-test-suite git submodule in test. According to the docs actions/checkout@v2 seems to need

  with:
    submodules: true
ringabout commented 3 years ago

The result: https://github.com/xflywind/NimYAML/runs/3123245361

flyx commented 3 years ago

So Windows has two issues:

And the third issue is that, despite those errors, the GitHub action succeeds. I would expect it to fail, not sure why it doesn't.

ringabout commented 2 years ago

devel bugs are already fixed. Feel free to close this PR.

flyx commented 2 years ago

Yeah I kinda forgot about this PR, wanted to do some own exploration but didn't really find the time. Nonwithstanding the Windows weirdness, I'll merge this since it's nice to have a github action :).

flyx commented 2 years ago

Hmm there's some choosenim weirdness on macos devel, going to assume that's a transient error in devel since it works with other builds.