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

ci: add github actions #372

Merged
merged 18 commits into from
Aug 28, 2019
Merged

ci: add github actions #372

merged 18 commits into from
Aug 28, 2019

Conversation

bpas247
Copy link
Member

@bpas247 bpas247 commented Aug 25, 2019

Relevant to 4324 in the React-Bootstrap repository.

Adds github actions, with a workflow for running tests.

NOTE We would need to need to setup a github secret for this to work properly: CODECOV_TOKEN.

Relevant to 4324 in the React-Bootstrap repository.

Adds github actions, with a workflow for running tests and a
workflow for release.

For the release workflow, there is an integration with
semantic-release. We would need to need to setup two github
secrets for semantic to work properly: `NPM_TOKEN` and `GH_TOKEN`.
since GitHub Actions is being integrated, it replaces the need
for Travis CI.
Was failing due to how windows' line endings work, which made
the formatter angry.
@bpas247 bpas247 marked this pull request as ready for review August 25, 2019 09:10
also removes an uneeded dependency, as its use case is being
handled by the github action.
@mxschmitt
Copy link
Member

I would not use the codecov Action, because we then fetch the dependencies multiple times and rum the tests multiple times. The codecov npm package works great :)

@bpas247
Copy link
Member Author

bpas247 commented Aug 26, 2019

I would not use the codecov Action, because we then fetch the dependencies multiple times and rum the tests multiple times. The codecov npm package works great :)

Sure, but if the concern is that it will upload the test coverage multiple times, then it could just be solved by having it run as a separate job (which is how I organized it here, as it re-runs the tests and uploads the coverage results after the main test job completes with a success).

@mxschmitt mxschmitt mentioned this pull request Aug 26, 2019
@taion
Copy link
Member

taion commented Aug 26, 2019

But Codecov works just fine when you upload the coverage multiple times. It merges the coverage reports into a single combined report.

This is actually useful when different test runs exercise different code branches, e.g. if you have an "if Firefox" vs "if Chrome" branch in the code.

@bpas247
Copy link
Member Author

bpas247 commented Aug 26, 2019

But Codecov works just fine when you upload the coverage multiple times. It merges the coverage reports into a single combined report.

Oh that's cool, so it's probably not worth running it as a separate job then. We should just bake it into the main testing suite job then.

CodeCov merges all uploaded reports into a single report, so it's
not an issue to upload the report multiple times.

We still need to define the GitHub secret for CodeCov in order
for this to work.
@mxschmitt
Copy link
Member

mxschmitt commented Aug 26, 2019

I would still not use the codecov action. We only need to execute npx codecov and it will be uploaded. No need for spawning another Docker container (https://github.com/codecov/codecov-action/blob/master/Dockerfile). Both are doing actually the same except, that in the Docker container the bash script of codecov will be ran, which detects the language etc. In the end the codecov Action has more pitfalls.

@bpas247
Copy link
Member Author

bpas247 commented Aug 26, 2019

I would still not use the codecov action. We only need to execute npx codecov and it will be uploaded. No need for spawning another Docker container (https://github.com/codecov/codecov-action/blob/master/Dockerfile). Both are doing actually the same except, that in the Docker container the bash script of codecov will be ran, which detects the language etc. In the end the codecov Action has more pitfalls.

So I'm gonna have to disagree with you, because if you look at the CI build logs for the react-bootstrap PR then you'd see that even though the code coverage is failed to be reported, the CI build still passes. Using the GitHub action in this PR actually catches the CI build failing when it's not able to upload the report.

I thought about it, and it doesn't really make sense for this PR
to try and accomplish two different things.

The semantic-release integration should be in an another PR, so
removing it for now.
@bpas247 bpas247 changed the title ci: add github actions and integrate semantic-release ci: add github actions Aug 27, 2019
@mxschmitt
Copy link
Member

I would still not use the codecov action. We only need to execute npx codecov and it will be uploaded. No need for spawning another Docker container (https://github.com/codecov/codecov-action/blob/master/Dockerfile). Both are doing actually the same except, that in the Docker container the bash script of codecov will be ran, which detects the language etc. In the end the codecov Action has more pitfalls.

So I'm gonna have to disagree with you, because if you look at the CI build logs for the react-bootstrap PR then you'd see that even though the code coverage is failed to be reported, the CI build still passes. Using the GitHub action in this PR actually catches the CI build failing when it's not able to upload the report.

True, I've submitted a fix for it here: codecov/codecov-node#144

package.json Outdated Show resolved Hide resolved
@jquense
Copy link
Member

jquense commented Aug 27, 2019

I'm not sure semantic-release is the best idea. I've used it a few times on other projects and it's ok, but tends to be kinda of annoying to deal with, especially around prereleases and manual releases.

How is authentication working here? whose npm token is going to be used? It also precludes us from requiring 2FA for publishing which is maybe a good idea

@bpas247
Copy link
Member Author

bpas247 commented Aug 27, 2019

I'm not sure semantic-release is the best idea. I've used it a few times on other projects and it's ok, but tends to be kinda of annoying to deal with, especially around prereleases and manual releases.

Agreed, which is why it was removed as of 45fcbee.

How is authentication working here? whose npm token is going to be used? It also precludes us from requiring 2FA for publishing which is maybe a good idea

We don't need that npm token anymore :)

We aren't integrating semantic-release anymore, so these config
options need to be reverted.
@jquense
Copy link
Member

jquense commented Aug 27, 2019

oops sorry missed it was gone. thanks github :P

README.md Outdated
[codecov-badge]: https://codecov.io/gh/react-bootstrap/react-overlays/branch/master/graph/badge.svg
[test-badge]: https://github.com/react-bootstrap/react-overlays/workflows/test/badge.svg
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'm pretty sure this badge link doesn't actually work. @mxschmitt do you mind suggesting what the correct link should be?

I'm not reverting the changes made to the lint script, since that
was for the GitHub actions testing ci builds.
The CI was unfortunately skipping builds that weren't linux
containers with jobs that had a CodeCov step (which is very
strange behavior). Running it as a separate job should fix this
issue.
Having to install google chrome externally for macOS build
was causing a checksum mismatch error, so removing it now until
we can figure out what is causing it.
@bpas247

This comment has been minimized.

Since it can only be ran on linux containers (sigh), we need this
safeguard in place.
@bpas247 bpas247 merged commit bd5c6eb into master Aug 28, 2019
@bpas247 bpas247 deleted the ci/add-github-actions branch August 28, 2019 00:55
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.

4 participants