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.
This commit is contained in:
4
.github/ISSUE_TEMPLATE/flakies.md
vendored
4
.github/ISSUE_TEMPLATE/flakies.md
vendored
@@ -3,7 +3,7 @@ Tests that fail randomly are called "flakies", this one seems to be one:
|
||||
|
||||
**Randomized seed:** FILL_WITH_RANDOM_SEED
|
||||
|
||||
**Travis failed build:** FILL_WITH_TRAVIS_FAILED_BUILD_LINK
|
||||
**Failed action:** FILL_WITH_A_LINK_WHERE_THE_FAILURE_IS_SHOWN
|
||||
|
||||
**Failure:**
|
||||
|
||||
@@ -26,7 +26,7 @@ do
|
||||
done
|
||||
```
|
||||
|
||||
You can also try running a single spec in Travis:
|
||||
You can also try running a single spec:
|
||||
Add option `:focus` to the spec and push your branch to Github, for example:
|
||||
```ruby
|
||||
scenario 'Show', :focus do
|
||||
|
||||
2
.github/PULL_REQUEST_TEMPLATE
vendored
2
.github/PULL_REQUEST_TEMPLATE
vendored
@@ -1,6 +1,6 @@
|
||||
## References
|
||||
|
||||
> Related Issues/Pull Requests/Travis Builds/Rollbar errors/etc...
|
||||
> Related Issues/Pull Requests/errors/etc...
|
||||
|
||||
## Objectives
|
||||
|
||||
|
||||
40
.github/workflows/tests.yml
vendored
Normal file
40
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Test suite
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- i18n_master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-18.04
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10.10
|
||||
ports: ["5432:5432"]
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
env:
|
||||
POSTGRES_USER: consul
|
||||
POSTGRES_PASSWORD: ""
|
||||
env:
|
||||
PGUSER: consul
|
||||
POSTGRES_HOST: postgres
|
||||
RAILS_ENV: test
|
||||
COVERALLS: true
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
bundler-cache: true
|
||||
- name: Setup NPM
|
||||
uses: actions/setup-node@v1
|
||||
- name: Copy secrets and database files
|
||||
run: for i in config/*.example; do cp "$i" "${i/.example}"; done
|
||||
- name: Setup database
|
||||
run: bundle exec rake db:setup
|
||||
- name: Compile assets
|
||||
run: bundle exec rake assets:precompile > /dev/null 2>&1
|
||||
- name: Run test suite
|
||||
run: bin/rspec
|
||||
Reference in New Issue
Block a user