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

Move to Github Actions #785

Merged
merged 14 commits into from
May 22, 2020
Merged

Move to Github Actions #785

merged 14 commits into from
May 22, 2020

Conversation

NotMoni
Copy link
Member

@NotMoni NotMoni commented Apr 23, 2020

No description provided.

Copy link
Member

@larson-carter larson-carter left a comment

Choose a reason for hiding this comment

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

I agree that this is a great move. Approved!!

Copy link
Member

@Richienb Richienb left a comment

Choose a reason for hiding this comment

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

Since we're moving to Actions, it makes sense to remove the .travis.yml file.

NotMoni and others added 2 commits May 19, 2020 18:21
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
Signed-off-by: Moni <40552237+NotMoni@users.noreply.github.com>
@NotMoni
Copy link
Member Author

NotMoni commented May 19, 2020

Done 🦄

- run: npm run lint
- run: npm run coverage
env:
CI: true
Copy link
Member

Choose a reason for hiding this comment

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

GitHub Actions sets CI automatically now: https://github.blog/changelog/2020-04-15-github-actions-sets-the-ci-environment-variable-to-true/

Coveralls have their own GitHub Actions, so, it's probably better to use it than to run coverage script: https://github.com/coverallsapp/github-action

Copy link
Member

Choose a reason for hiding this comment

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

GitHub Actions sets CI automatically now

Awesome 😍

Copy link
Member Author

Choose a reason for hiding this comment

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

GitHub Actions sets CI automatically now: https://github.blog/changelog/2020-04-15-github-actions-sets-the-ci-environment-variable-to-true/

Coveralls have their own GitHub Actions, so, it's probably better to use it than to run coverage script: https://github.com/coverallsapp/github-action

So use coveralls?

uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm run lint
Copy link
Member

Choose a reason for hiding this comment

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

It's better to separate lint into a single action - this way it will run only once on a selected version of Node/OS and give faster and more prominent feedback to a contributor.

Copy link
Member

Choose a reason for hiding this comment

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

I agree. Could we make it a separate workflow? First node then lint?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, Should I make it two files?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that what I mean

Copy link
Member

Choose a reason for hiding this comment

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

@NotMoni Yes make it into 2 files.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure 👍

NotMoni added 4 commits May 20, 2020 16:37
Signed-off-by: Moni <40552237+NotMoni@users.noreply.github.com>
Signed-off-by: Moni <40552237+NotMoni@users.noreply.github.com>
Signed-off-by: Moni <40552237+NotMoni@users.noreply.github.com>
Signed-off-by: Moni <40552237+NotMoni@users.noreply.github.com>
@NotMoni
Copy link
Member Author

NotMoni commented May 20, 2020

@larson-carter and @tinovyatkin
Please look over my changes. 🦄

@NotMoni NotMoni requested a review from Richienb May 20, 2020 20:49
name: Lint CI

on:
[push, pull_request]
Copy link
Member

Choose a reason for hiding this comment

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

It makes no sense to lint on a push as nobody will see/check that. Keep just pull_request here

[push, pull_request]

jobs:
build:
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 lint is better named for the task here. It will be visible in check and may confuse.

Copy link
Member

Choose a reason for hiding this comment

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

I agree.

Comment on lines 10 to 21
runs-on: [ubuntu-latest, macos-latest, ubuntu-16.04]

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
Copy link
Member

Choose a reason for hiding this comment

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

It's a real overkill to lint on 9 platforms. Just run on Ununtu latest with the Node LTS (12.x) - we are not testing ESLint here, we linting our code.

@@ -0,0 +1,22 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
name: Coverage CI
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 coverage is a bad name here. Just CI or Test. Coverage is a function from tests.

name: Coverage CI

on:
[push, pull_request]
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 just pull_request here is enough, we currently don't have any automatic deploy in place, so, CI result on a push is irrelevant.

Comment on lines 10 to 14
runs-on: [ubuntu-latest, macos-latest, ubuntu-16.04]

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
Copy link
Member

Choose a reason for hiding this comment

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

Again, I believe 9 tests is too much for the library that doesn't have any platform-specific code.
We can test only on latest Node for macOs an test on windows instead of old Ubuntu:

    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        node: [14.x, 12.x, 10.x]
        exclude:
          # On Windows, run tests with only the LTS environments.
          - os: windows-latest
            node: 10.x
          - os: windows-latest
            node: 14.x
          # On macOS, run tests with only the LTS environments.
          - os: macOS-latest
            node: 10.x
          - os: macOS-latest
            node: 14.x

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

uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm run coverage
Copy link
Member

Choose a reason for hiding this comment

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

npm run coverage does nothing if npm test wasn't run before.
Please check #805 as if it will be merged we will need a special step and condition to test on Node 10.x

NotMoni added 3 commits May 20, 2020 21:58
Runs only on: Ubuntu & Node.js LTS
Signed-off-by: Moni <40552237+NotMoni@users.noreply.github.com>
@NotMoni
Copy link
Member Author

NotMoni commented May 21, 2020

@tinovyatkin I think I fixed all your suggestions. 👀
Sorry in advance if I messed up somewhere 😭

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/lint.yml Outdated Show resolved Hide resolved
@xxczaki
Copy link
Member

xxczaki commented May 21, 2020

@NotMoni Remember to update the badge in README before/just after merging ;)

@xxczaki xxczaki mentioned this pull request May 21, 2020
35 tasks
@NotMoni
Copy link
Member Author

NotMoni commented May 21, 2020

@xxczaki Ahhhh yea, sure mate 👍

Copy link
Member

@larson-carter larson-carter left a comment

Choose a reason for hiding this comment

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

We just have 2 suggestions that need to be merged into this PR. Then it will be ready to be pulled.

@NotMoni
Copy link
Member Author

NotMoni commented May 21, 2020

Hey @larson-carter , I will update it later today. Busy rn.

NotMoni and others added 2 commits May 22, 2020 12:22
Co-authored-by: Konstantin Vyatkin <tino@vtkn.io>
Co-authored-by: Konstantin Vyatkin <tino@vtkn.io>
@NotMoni
Copy link
Member Author

NotMoni commented May 22, 2020

cc/ @larson-carter
The Needed changes have been made.

@NotMoni
Copy link
Member Author

NotMoni commented May 22, 2020

@NotMoni Remember to update the badge in README before/just after merging ;)

I have added the badge link, but it won't be rendered since we have not enable action on this repo until this PR gets merged.

@tinovyatkin tinovyatkin merged commit 29d7556 into node-fetch:master May 22, 2020
@tinovyatkin tinovyatkin mentioned this pull request May 22, 2020
@NotMoni NotMoni deleted the NotMoni-github-actions branch May 22, 2020 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants