Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub CI #5

Merged
merged 8 commits into from
Mar 24, 2020
Merged

Add GitHub CI #5

merged 8 commits into from
Mar 24, 2020

Conversation

pjoe
Copy link
Contributor

@pjoe pjoe commented Mar 22, 2020

This adds initial CI using github actions.

Currently only web-min-nocompute and node-devel is build, but easy enough to add the other configs.

Also added a very basic test using jest that is run on each build. Will add better tests later :)

- Use bash as pushd is not valid for sh

- Also reset glslang.y

- Use make -j (with number of cores)
- Use docker-compose for building and running
@pjoe pjoe changed the title Add GitHub ci Add GitHub CI Mar 22, 2020
@pjoe
Copy link
Contributor Author

pjoe commented Mar 22, 2020

Hmm looks like the jest test is failing on GitHub even though it works locally, maybe something with specific node.js version.

https://github.com/pjoe/glslang.js/runs/525479759

Will take a look at converting to TypeScript tomorrow

@kainino0x
Copy link
Owner

Since you're setting up tests, it would be useful to replicate the 3 test shaders from https://github.com/kainino0x/glslang.js/blob/master/tests/helper.mjs

Will take a look at converting to TypeScript tomorrow

I don't think there's any need to use typescript for a few small tests, probably easier if we don't add more complexity to the build.

@pjoe
Copy link
Contributor Author

pjoe commented Mar 23, 2020

I saw the tests in helper.mjs, but ended up starting with something even simpler - just to get it working. My thinking was that after that I would try adding some of the tests from glslang itself: https://github.com/kainino0x/glslang/tree/851f3daad0efb7e69a6bec4fd07fe60067104a4a/Test. Maybe even validate the output too :)

About TypeScript: as it's currently failing with some issue between jest and babel, I was merely thinking that this could be avoided by running the tests through ts (guess I'm also so used to it, that it's sort of second nature to me by now). Will try some more if I can get it working with just plain old js.

@pjoe
Copy link
Contributor Author

pjoe commented Mar 23, 2020

After spending a bit more time investigating, seems like jest and mjs really are not good friends (yet): jestjs/jest#9430

At least I got it failing the same way locally, not sure how I had it working before :s

Will give it a try with typescript, as this is something I know 'should work' tm :D

@pjoe
Copy link
Contributor Author

pjoe commented Mar 23, 2020

Hmm after even more investigation:

Something is wonky with the gslang build itself.

When only building node-devel it generates glslang.js with ESM and Promise. If building web-min-nocompute AND node-devel it generates glslang.js with normal node.js exports :S

- Have to build node-devel twice to get right output (without import.meta)

- Added tests from helper.mjs
@pjoe
Copy link
Contributor Author

pjoe commented Mar 23, 2020

Got it working now: https://github.com/pjoe/glslang.js/runs/528548315?check_suite_focus=true

For some obscure reason have to run the node-devel build twice to get it to create the correct .js file without ESM promise loader using import.meta

Also added the tests from helper.mjs properly setup with jest

Copy link
Owner

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look great. Do you want to debug the issue where you have to build twice or should we go ahead and merge? Happy to merge now and fix later, especially since we aren't doing frequent rereleases.

@pjoe
Copy link
Contributor Author

pjoe commented Mar 24, 2020

Let's merge first :)

Would still like to figure out the build issue, but that can be done afterwards. I also suspect the issue is in glslang itself and not in this repo, but not sure.

@kainino0x kainino0x merged commit 2ff5b5d into kainino0x:master Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants