Skip to content

👷 Move to GitHub Actions - #49

Merged
medikoo merged 7 commits into
Gozala:masterfrom
harshzalavadiya:move-github-actions
Jan 16, 2021
Merged

medikoo merged 7 commits into
Gozala:masterfrom
harshzalavadiya:move-github-actions

Conversation

@harshzalavadiya

@harshzalavadiya harshzalavadiya commented Jan 5, 2021 •

Copy link
Copy Markdown
Contributor

Split from #46

This PR is to move CI from Travis to GitHub Actions

I'm not adding node 0.6 in legacy matrix since it's not able to do setup and same fails on travis and GH actions both and even if setup succeds it keeps on throwing segment fault

@medikoo medikoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @harshzalavadiya ! It looks very promising. I have just few comments

Comment thread .github/workflows/ci-legacy.yml Outdated
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["0.8"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it not possible to test v0.6?

To be fully bulletproof on this level, we should test all major since v0.6 (so also v0.10, v0.12, v4, v6 and v8)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I tried doing multiple builds yesterday on github actions also on DO server but sadly all I got was segment fault errors same is happening on Travis CI as well if you see current build logs

Here's commit history of old repo https://github.com/tiny-leaf/querystring-old/commits/node-0.6-test

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ok, thanks for investigating that. If that's not possible, we need to stick to 0.8 as you've configured

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Still, can we have v0.10, v0.12, v4, v6 and v8 covered?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread .npmignore Outdated
@@ -0,0 +1,3 @@
test
.github
package-lock.json

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's ditchpackage-lock.json from here (it is automatically ignored by npm)

Also we have this file just added to repo with #47, so I believe this have to be updated against master

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, Since History.md was already there I have added CHANGELOG.md

@medikoo medikoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @harshzalavadiya ! Please see my comments

Comment thread .npmignore Outdated
History.md
test
.github
CHANGELOG.md

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe CHANGELOG.md is automatically taken by npm (ignoring it is ineffective)

Comment thread .github/workflows/ci-legacy.yml Outdated
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["0.8"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Still, can we have v0.10, v0.12, v4, v6 and v8 covered?

Comment thread .github/workflows/ci.yml Outdated
Comment on lines +29 to +33
- name: Publish
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest' && matrix.node == '14.x'
run: echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc && npm publish --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's remove publication from here.

It should be done only on version tag builds, so if configured with CI, I think it's best if we create another dedicated workflow file for it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@medikoo medikoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for update @harshzalavadiya ! Please see my comments

Comment thread .github/workflows/release.yml Outdated
on:
push:
branches:
- master

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ideally this should be configured on tags.

Nice workflow I have setup in other packages i that:

  1. master build checks wether version is bumped in package.json If it's bumped then tag is pushed to repository
  2. tag build publishes new version to npm

You may check how that's achieved e.g. here: https://github.com/serverless/utils/tree/master/.github/workflows. It is also documented here: https://github.com/serverless/utils/blob/master/RELEASE_PROCESS.md

Still I think it's totally fine if in scope of this PR we just focus on PR's and master validation (no publishing)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, using tags validation directly is much cleaner workflow, I have added tag validation instead of branch from example

@medikoo medikoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @harshzalavadiya ! I have just few suggestions to publication workflow and we should be good to go

Comment thread .github/workflows/release.yml Outdated
run: npm test

- name: Publish
run: echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc && npm publish --access public

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of that. Let's configure registry-url at actions/setup-node@v1 (as e.g. here: https://github.com/serverless/template-package/blob/50f01db83c28c7b7c8e8437564efe9fe73bd3434/.github/workflows/publish.yml#L35)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment thread .github/workflows/release.yml Outdated

runs-on: ${{ matrix.os }}
strategy:
matrix:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's not use matrix in that case (we're publishing in context of one env)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@harshzalavadiya

Copy link
Copy Markdown
Contributor Author

@medikoo sorry to be a bother but any feedback on this PR?

@medikoo medikoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @harshzalavadiya !

Sorry, I didn't look into it as simply I didn't receive any notification it's ready for review (review was not re-requested).

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