Commit Graph

9 Commits

Author SHA1 Message Date
Javi Martín
8ed8cc8b93 Use Coveralls Github Action to send test reports
Coveralls stopped working back in July when we reached build number 3790
because back when we used Travis we created builds from numbers 3791 to
35700.

After trying to change the numbers in several ways, all of them
resulting in a "No build matching CI build number" message, we're trying
the Github Action provided by Coveralls instead. In order to make it
work, we need to add the `simplecov-lcov` gem and generate the report at
`coverage/lcov.info`. Note that, for some reason, `simplecov-lcov`
doesn't seem to depend on `simplecov` and we need `simplecov` 0.18 or
later, so we're manually adding this dependency as well.
2022-11-29 14:51:22 +01:00
Senén Rodero Rodríguez
33d288f230 Use the latest available Ubuntu image to run tests
It is the Ubuntu 20.04 version at the time of writing.

Github Actions has deprecated the 18.04 we were using.
2022-08-22 17:10:33 +02:00
nathannaveen
cac6194acd chore: Set permissions for GitHub actions
Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
2022-06-13 00:58:13 +00:00
Javi Martín
eb4ee891c4 Reduce tests timeout in GitHub Actions
Sometimes a test gets stuck and and we have to wait until it times out
in order to check which files were being tested at the time.

The default timeout is six hours. I'm reducing it to one hour which
should still be plenty of time even on repositories with no knapsack
token.
2021-04-07 14:41:06 +02:00
Javi Martín
45693e084b Integrate coveralls with github actions
Somehow I thought it worked automatically, but we had to provide the
token.

The configuration is based on Coveralls instructions to run parallel
builds [1].

Alternatively we could use the Coveralls GitHub Action [2] which
slightly simplifies the workflow configuration and removes the
dependency of the coveralls gem. However, it also adds a dependency on
simplecov-lcov and requires configuring it to renerate LCOV files on
each run, so the benefits of using it are not that big.

[1] https://docs.coveralls.io/parallel-build-webhook
[2] https://github.com/coverallsapp/github-action/
2021-04-02 20:33:23 +02:00
Javi Martín
a504921eca Upload screenshots of failures with GitHub Actions 2021-04-02 20:30:20 +02:00
Javi Martín
cb596a8163 Fix build status badge
As mentioned in the GitHub Actions documentation [1]

> Note: Referencing the workflow file using the file path does not work
  if the workflow has a name.

[1] https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/adding-a-workflow-status-badge
2020-11-23 15:06:20 +01:00
Javi Martín
9c4d24d767 Use Knapscack Pro to run tests in parallel
Just like we used to do with Travis.

The configuration was taken from the Knapsack Pro documentation [1].

[1] https://docs.knapsackpro.com/2019/github-actions-ci-config-for-ruby-on-rails-project-with-mysql-redis-elasticsearch-how-to-run-parallel-tests
2020-11-23 14:00:36 +01:00
Javi Martín
375134ea04 Run the test suite using GitHub Actions
Using GitHub Actions has a few advantages over using Travis CI:

* More jobs can be run in parallel
* All CONSUL repositories on GitHub will be configured automatically

Besides, Travis have recently changed their policy twice. First, they
announced their site for free software projects would be shut down but
free software projects could still use their site for private projects.
And then, they limited the usage of their services for free software
projects.

Just like we used to do with Travis, we're enabling builds for pull
requests but not for pushed branches.

We're also building the master branch. Even if we never push to the
master branch directly, we're aware other CONSUL repositories do, so
we're running the tests for this case.
2020-11-23 14:00:33 +01:00