kemal icon indicating copy to clipboard operation
kemal copied to clipboard

Test Windows CI

Open mamantoha opened this issue 2 years ago • 10 comments

This was just a test for Windows CI

Finished in 49.14 seconds
121 examples, 13 failures, 16 errors, 0 pending

mamantoha avatar Apr 18 '23 20:04 mamantoha

to fix the check_ameba workflow go to Setting -> Actions -> General and check "Read and write permissions"

image

mamantoha avatar Apr 18 '23 20:04 mamantoha

Thanks a lot @mamantoha 👍 Could you please tell me why do we need the permissions for ameba

sdogruyol avatar Apr 18 '23 23:04 sdogruyol

@sdogruyol I don't know why https://github.com/crystal-ameba/github-action requires write permissions

mamantoha avatar Apr 19 '23 08:04 mamantoha

@mamantoha that's already enabled, do I need to do anything else?

sdogruyol avatar Apr 19 '23 08:04 sdogruyol

@sdogruyol I don't understand why check_ameba fails. It works fine on my fork.

mamantoha avatar Apr 19 '23 10:04 mamantoha

Just reran the workflow and it failed with the same error. Not sure what's wrong with permissions 🤷

sdogruyol avatar Apr 19 '23 12:04 sdogruyol

The Kemal::StaticFileHandler specs are failing because of this part:

https://github.com/kemalcr/kemal/blob/c995a2a9711d72d90b347683007b45bbaf495317/src/kemal/static_file_handler.cr#L30-L38

Both @public_dir and expanded_path contain the drive name, so file_path becomes something like C:\...\C:\.... Replacing the first line with just expanded_path = request_path makes all specs pass. I have not dug far enough to understand if the File.expand_path call has any significance on other platforms.

HertzDevil avatar Jul 11 '23 12:07 HertzDevil

StaticFileHandler probably just needs to be aligned with stdlib's implementation.

straight-shoota avatar Jul 11 '23 13:07 straight-shoota

That part in stdlib is:

    request_path = Path.posix(request_path)
    expanded_path = request_path.expand("/")

    file_path = @public_dir.join(expanded_path.to_kind(Path::Kind.native))

HertzDevil avatar Jul 11 '23 13:07 HertzDevil

Hi @HertzDevil @straight-shoota I don't have a Windows environment to test this build locally. Can someone else take over and continue working on this pull request? Thank you.

mamantoha avatar Jul 12 '23 09:07 mamantoha