Skip to content

Build: Fully migrate from Travis to GitHub Actions#589

Merged
mgol merged 3 commits intojquery:mainfrom
mgol:github-actions
Jun 22, 2022
Merged

Build: Fully migrate from Travis to GitHub Actions#589
mgol merged 3 commits intojquery:mainfrom
mgol:github-actions

Conversation

@mgol
Copy link
Member

@mgol mgol commented Mar 30, 2022

Initial setup was introduce in #588 so that anything is able to even run. This PR aims at migrating the whole setup.

Ref #588

@mgol mgol requested a review from fnagel March 30, 2022 16:36
@mgol
Copy link
Member Author

mgol commented Mar 30, 2022

@fnagel You may review not just the changes from this PR, but also the whole GitHub Actions config added in #588 and I'll make changes here. I wanted to first land something as without it no actions would run which makes it hard to verify changes.

@mgol
Copy link
Member Author

mgol commented Apr 4, 2022

@fnagel I'd like to merge it on Wednesday at the latest to be able to tackle other PRs on a working builder (the Travis one is broken at the moment for this repo and I don't really want to fix it considering this migration) like #587. If you could review before that day, great, if not, I still hope you can review post-merge. 🙂

Copy link
Member

@fnagel fnagel left a comment

Choose a reason for hiding this comment

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

+1 by reading. Looks good afaics.

FYI: you might want to create a branch for testing the GH actions, no need to run it in the main repo.

run: |
sudo apt-get install xsltproc

- name: Cache
Copy link
Member

Choose a reason for hiding this comment

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

You might want to add some more fallback restore keys:

restore-keys: |
    ${{ runner.os }}-node-${{ matrix.node-version }}-npm-lock-
    ${{ runner.os }}-node-${{ matrix.node-version }}-
    ${{ runner.os }}-node-
     ${{ runner.os }}-

Copy link
Member Author

Choose a reason for hiding this comment

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

That can be done, although I'm not sure if restoring across Node.js versions is the best idea. Sometimes, switching to a new Node.js major requires a full re-installation or some binary packages may not install properly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, I don't see a point of including both ${{ runner.os }}-node-${{ matrix.node-version }}-npm-lock- and ${{ runner.os }}-node-${{ matrix.node-version }}- - they have the same variable paths so if one matches, the other one should as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

...although, to that point, the official docs also show a similar example:
https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
Do you see a reason to include all of them?

Copy link
Member

Choose a reason for hiding this comment

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

I think the restore keys work like a fallback chain for always restoring something at all and then updating it. Speeds up builds when using version matrix. Never had issues with it but not 100% sure if it's not possible to cause issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it will cause issues, it just looks redundant. There should be no situation where the cache entry for ${{ runner.os }}-node-${{ matrix.node-version }}-npm-lock- for given os & node-version values is matched but for ${{ runner.os }}-node-${{ matrix.node-version }}- for those same values it does not match.

run: |
sudo apt-get install xsltproc

- name: Cache
Copy link
Member

Choose a reason for hiding this comment

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

Installing npm before loading caching feels more natural to me. I would move Use Node.js ${{ matrix.NODE_VERSION }} before the cache restoring.

@mgol
Copy link
Member Author

mgol commented Jun 22, 2022

OK, let's leave it as-is; we can revisit if it causes issues.

@mgol mgol merged commit 6ac36e8 into jquery:main Jun 22, 2022
@mgol mgol deleted the github-actions branch June 22, 2022 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants