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

Switch from Travis CI to GitHub Actions #504

Merged
merged 20 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/other.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Other

on:
- push
- pull_request

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
- run: npm run lint
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
- run: npm run integration
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests

on:
- push
- pull_request

jobs:
test:
name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Copy link
Collaborator

Choose a reason for hiding this comment

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

fail-fast: false is needed here

node_version:
- 13
- 12
- 10
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- run: npm install
- run: npm run test-coverage
- uses: coverallsapp/github-action@master
continue-on-error: true
with:
github-token: ${{ secrets.github_token }}
parallel: true
- uses: coverallsapp/github-action@master
continue-on-error: true
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
Copy link
Collaborator

@fisker fisker Feb 1, 2020

Choose a reason for hiding this comment

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

On my experience, this not right, seem need another job wait for matrix, not sure. I tried in this way before.

So I dont use parallel https://github.com/fisker/id-placeholder/blob/ae506a0069bb459f6100f2c317f377ba9f8651de/.github/workflows/continuous-integration.yml#L52

Also, this action some times fail for no reason, issue can found on their repo, so I use continue-on-error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The parallel-finished is what they document should be used when running multiple tests in parallel: https://github.com/coverallsapp/github-action#inputs

I added the continue-on-error on error now 👍 Good feedback!

18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
},
"scripts": {
"test": "xo && nyc ava",
"lint": "node ./test/lint/lint.js",
"test-coverage": "nyc --reporter=lcov ava",
"lint": "node ./test/lint/lint.js && xo",
Copy link
Owner

Choose a reason for hiding this comment

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

XO is now run twice, both on test and lint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sindresorhus Yes and no. In the GitHub CI pipe test-coverage is run rather than test. Partly to get coverage report and partly to move the xo part from being run on every Node.js version to being run just once as part of the linting flow.

So, test.yml runs test-coverage while other.yml (suggestion on better name?) runs lint and integration

I thought it was best to leave the test as is, as that's likely the one that gets run manually the most.

"integration": "node ./test/integration/test.js"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# eslint-plugin-unicorn [![Build Status](https://travis-ci.org/sindresorhus/eslint-plugin-unicorn.svg?branch=master)](https://travis-ci.org/sindresorhus/eslint-plugin-unicorn) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master)
# eslint-plugin-unicorn ![Tests](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Tests/badge.svg) ![Other](https://github.com/sindresorhus/eslint-plugin-unicorn/workflows/Other/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/eslint-plugin-unicorn/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/eslint-plugin-unicorn?branch=master)

<img src="https://cloud.githubusercontent.com/assets/170270/18659176/1cc373d0-7f33-11e6-890f-0ba35362ee7e.jpg" width="180" align="right">

Expand Down