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

Migrate from circle ci to github actions #129

Merged
merged 15 commits into from
Nov 14, 2024
Merged

Conversation

dany-pellerin
Copy link
Contributor

@dany-pellerin dany-pellerin commented Nov 5, 2024

This PR migrates from CircleCI to GH actions.

For context, the Makefile is used for development and was used in CircleCi. The vanilla-demo job uses the makefile to build the vanilla files, however for the lib, web and other demos, the makefile can't make use of the cache and installs all dependencies every time it runs which could become costly in the long run and also can't run the tasks concurrently.

The github actions that were created also output the artifacts which will make it a lot easier to debug if an issue arises.

The deploy on CircleCi was using gsutil which is a legacy tool (see https://cloud.google.com/storage/docs/gsutil). The github steps in the workflows use official actions. For the deploy if there's an issue with publishing on npm, the other steps won't run (deploying the SDK to GCS and the demo for google storage artifacts).

The deploy steps are fairly complex and were very hard to test:

  • we need to deploy the sdk to npm
  • we need to deploy multiple versions of the SDK to GCS (depends on the version, a matrix was used to handle that)

Example
image

  • we deploy the demo-images docker image to GC artifacts

All steps have been tested except the following:

  • publishing on npm was tested using the -dry-run flag
  • uploading the SDK to gcs (it will be tested on the next release, we can do it manually and fix the workflow)
  • uploading the demos to google artifacts (it will be tested on the next release, we can do it manually and fix the workflow)

These changes mimic the same behavior that the CircleCi was doing, however we typically use terraform for deploying and the deploy steps should probably be moved to terraform. This should be addressed in the future.

Also, the bash script that checks for the versions to publish would need to be converted to a reusable github action. It installs dependencies (it needs semver) needlessly, it's hard to manually run. It could easily be created using a javascript action, it would be a lot easier to test, would be more robust and performant. This might be done in the future. Since the deploy rarely runs, it's not a problem for now.

The script I created can be used for any package available in npm to manually test the different scenarios. It doesn't upload anything, it only returns an array which contains the versions that need to be updated.
useage example: ./scripts/versions-to-update.sh core-js v1.5.10

@dany-pellerin dany-pellerin self-assigned this Nov 5, 2024
@dany-pellerin dany-pellerin force-pushed the migrate-to-gh-actions branch 4 times, most recently from 38d7e61 to e719d8a Compare November 5, 2024 21:48
@dany-pellerin dany-pellerin force-pushed the migrate-to-gh-actions branch 8 times, most recently from 3dfa38d to a9b07de Compare November 8, 2024 15:14
@dany-pellerin dany-pellerin force-pushed the migrate-to-gh-actions branch 11 times, most recently from 921176d to 95b6b15 Compare November 8, 2024 17:56
@dany-pellerin dany-pellerin force-pushed the migrate-to-gh-actions branch 3 times, most recently from 9daaef2 to d15314f Compare November 8, 2024 22:29
@dany-pellerin dany-pellerin force-pushed the migrate-to-gh-actions branch 8 times, most recently from 3621786 to affc13d Compare November 12, 2024 17:06
@dany-pellerin dany-pellerin marked this pull request as ready for review November 12, 2024 18:55
souzamari
souzamari previously approved these changes Nov 13, 2024
Copy link
Contributor

@souzamari souzamari left a comment

Choose a reason for hiding this comment

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

Great job! I left some small comments. As for the service account for CD we will most likely have to update it, but I think there is some work to be done in terraform since the default name is "gh-ci-..."

.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
.github/workflows/release.yml Show resolved Hide resolved
@souzamari souzamari dismissed their stale review November 13, 2024 15:44

small items to address before merge

Copy link
Contributor

@souzamari souzamari left a comment

Choose a reason for hiding this comment

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

LGTM. I would still get Antoine feedback/review for the release workflow and the version update since he is the expert on it ;)

scripts/versions-to-update.sh Outdated Show resolved Hide resolved
@dany-pellerin dany-pellerin merged commit 731c43f into master Nov 14, 2024
7 checks passed
@dany-pellerin dany-pellerin deleted the migrate-to-gh-actions branch November 14, 2024 16:06
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.

3 participants