Skip to content

Migrate to GitHub Actions #3992

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

Merged
merged 3 commits into from
Mar 11, 2020
Merged

Conversation

smorimoto
Copy link
Contributor

GitHub Actions can execute up to 20 workflows concurrently per repository, I've added several LTS versions of Node.js. It also includes some changes such as adding npm caches, renaming old environment variables, and deleting unused Travis CI configuration files.

@smorimoto
Copy link
Contributor Author

If you want, I can add an action to automatically release to npm and GitHub. It's great to reduce human error by automatically publishing in the way.

@smorimoto
Copy link
Contributor Author

I also changed from npm install to npm ci.
https://docs.npmjs.com/cli/ci.html

@bobzhang
Copy link
Member

bobzhang commented Dec 2, 2019

@imbsky is github actions out of beta? This looks good in the right direction, but not sure if we should do such transition immediately
cc @cristianoc

@smorimoto
Copy link
Contributor Author

Yes, GitHub Actions was recently released publicly. It's currently very stable and I can recommend it.

@thangngoc89
Copy link
Contributor

There has been complains on Reason Discord about the maximum cache size of GitHub Action that doesn’t fit any typical ReasonML/Ocaml projects

@anmonteiro
Copy link
Contributor

I wouldn't consider BuckleScript a "typical" OCaml project. It's also not using cache in the current CI setup: https://github.com/BuckleScript/bucklescript/blob/master/.circleci/config.yml

@cristianoc
Copy link
Collaborator

@anmonteiro the current CI config in master is about 2X faster than Azure CI configured with full cache on linux (part of this investigation #3910).

@smorimoto
Copy link
Contributor Author

@thangngoc89 I have already mentioned that to the Actions team and they are working on improvements now. They will also improve cache save and restore times. See this thread actions/cache#6.

@smorimoto
Copy link
Contributor Author

Actions team has decided to increase the cache limit significantly next month.

@smorimoto
Copy link
Contributor Author

Finally, the cache limit was bumped. 2GB is probably enough for this project.
actions/cache#6

@bobzhang
Copy link
Member

hi  @imbsky are you still interested in this?

@smorimoto
Copy link
Contributor Author

Yes

@smorimoto
Copy link
Contributor Author

I have worked with GitHub for several months on bumping cache limits, improving cache save and restore speed, mostly for OCaml projects. I don't think we've accomplished everything we need to do right now, but it's definitely better than it was before, and that's why so many projects have moved to GitHub Actions.

@smorimoto
Copy link
Contributor Author

Well, the CI for this project does the same thing as a simple Node.js project. (We aren't currently doing such a heavy processing in CI.)

@smorimoto
Copy link
Contributor Author

I resolved the conflict.

@smorimoto
Copy link
Contributor Author

and I have removed the cache config for npm packages. This is because the BuckleScript uses a very small number of npm packages, and caching is slower in this case. (Caching is not zero cost. Imagine the time it takes to compress, upload, download, and decompress the cache.)

@bobzhang
Copy link
Member

@imbsky sorry for the dumb question, where can I read the CI logs? can you do a rebase against the master

@smorimoto smorimoto force-pushed the github-actions branch 2 times, most recently from a1a661d to a4c6599 Compare March 11, 2020 13:08
@smorimoto
Copy link
Contributor Author

No, that's a natural question. You can see the logs here.
https://github.com/imbsky/bucklescript/actions
GitHub Actions will not work with PR, which is the first introduction of GitHub Actions from forked repository. This may sound trouble, but let's compromise for now.
and I rebased to the master when I resolved the conflict.

@smorimoto
Copy link
Contributor Author

Well, the test fails for some reason. What should I do?

/home/runner/work/bucklescript/bucklescript/scripts/ciTest.js:148

                throw new Error(
npm ERR! code ETARGET
                ^
npm ERR! notarget No matching version found for bs-platform@^7.3.0-dev.1.

npm ERR! notarget In most cases you or one of your dependencies are requesting
Error: clean && install & build theme basic failed
npm ERR! notarget a package version that doesn't exist.
    at /home/runner/work/bucklescript/bucklescript/scripts/ciTest.js:148:23
npm ERR! notarget 
    at ChildProcess.exithandler (child_process.js:310:5)
npm ERR! notarget It was specified as a dependency of 'basic'
    at ChildProcess.emit (events.js:311:20)
npm ERR! notarget 
    at maybeClose (internal/child_process.js:1021:16)

    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2020-03-11T13_15_23_099Z-debug.log

npm ERR! Test failed.  See above for more details.
##[error]Process completed with exit code 1.

@bobzhang
Copy link
Member

No, that's a natural question. You can see the logs here.
https://github.com/imbsky/bucklescript/actions
GitHub Actions will not work with PR, which is the first introduction of GitHub Actions from forked repository. This may sound trouble, but let's compromise for now.
and I rebased to the master when I resolved the conflict.

Can we have some basic one (it is okay not working) but leaving circleCI config there during the transition? Also for the build matrix, in the begginning, mac os/linux and node v8 seems to be a good default.

lets dig why it fails later

@smorimoto
Copy link
Contributor Author

I temporarily restored the CircleCI configuration. Once we have successfully run a test on Actions, remove it.

in the begginning, mac os/linux and node v8 seems to be a good default.

All right, I updated actions config.

@bobzhang
Copy link
Member

@imbsky cool, thanks!

@bobzhang bobzhang merged commit ffc798e into rescript-lang:master Mar 11, 2020
@smorimoto smorimoto deleted the github-actions branch March 11, 2020 13:36
@smorimoto
Copy link
Contributor Author

👍

@smorimoto
Copy link
Contributor Author

Oh, maybe is update package-lock.json the cause?

{
-  "version": "7.2.0-dev.4",
+  "version": "7.3.0-dev.1",
}

@smorimoto
Copy link
Contributor Author

Hmm... Circle CI seems to be working. Disregard it.

@bobzhang
Copy link
Member

@imbsky are you aware that github actions provide ssh functionality? one killer feature for circleCI is that it allows you to ssh into the CI machine

@smorimoto
Copy link
Contributor Author

There are several actions that can do that.

@smorimoto
Copy link
Contributor Author

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.

5 participants