Merge pull request #4265 from consul/actions
Run the test suite using GitHub Actions
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
|
**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:**
|
**Failure:**
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ do
|
|||||||
done
|
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:
|
Add option `:focus` to the spec and push your branch to Github, for example:
|
||||||
```ruby
|
```ruby
|
||||||
scenario 'Show', :focus do
|
scenario 'Show', :focus do
|
||||||
|
|||||||
2
.github/PULL_REQUEST_TEMPLATE
vendored
2
.github/PULL_REQUEST_TEMPLATE
vendored
@@ -1,6 +1,6 @@
|
|||||||
## References
|
## References
|
||||||
|
|
||||||
> Related Issues/Pull Requests/Travis Builds/Rollbar errors/etc...
|
> Related Issues/Pull Requests/errors/etc...
|
||||||
|
|
||||||
## Objectives
|
## Objectives
|
||||||
|
|
||||||
|
|||||||
51
.github/workflows/tests.yml
vendored
Normal file
51
.github/workflows/tests.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
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
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
ci_node_total: [5]
|
||||||
|
ci_node_index: [0, 1, 2, 3, 4]
|
||||||
|
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
|
||||||
|
env:
|
||||||
|
KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }}
|
||||||
|
KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }}
|
||||||
|
KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }}
|
||||||
|
KNAPSACK_PRO_FIXED_QUEUE_SPLIT: true
|
||||||
|
KNAPSACK_PRO_LOG_LEVEL: info
|
||||||
|
run: bin/knapsack_pro_rspec
|
||||||
23
.travis.yml
23
.travis.yml
@@ -1,23 +0,0 @@
|
|||||||
language: ruby
|
|
||||||
addons:
|
|
||||||
postgresql: "9.4"
|
|
||||||
chrome: stable
|
|
||||||
cache: bundler
|
|
||||||
bundler_args: --without development
|
|
||||||
before_script:
|
|
||||||
- for i in config/*.example; do cp "$i" "${i/.example}"; done
|
|
||||||
- bundle exec rake db:setup
|
|
||||||
script:
|
|
||||||
- "bundle exec rake assets:precompile RAILS_ENV=test > /dev/null 2>&1"
|
|
||||||
- "bin/knapsack_pro_rspec"
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true
|
|
||||||
- KNAPSACK_PRO_LOG_LEVEL=info
|
|
||||||
- KNAPSACK_PRO_CI_NODE_TOTAL=5
|
|
||||||
matrix:
|
|
||||||
- KNAPSACK_PRO_CI_NODE_INDEX=0
|
|
||||||
- KNAPSACK_PRO_CI_NODE_INDEX=1
|
|
||||||
- KNAPSACK_PRO_CI_NODE_INDEX=2
|
|
||||||
- KNAPSACK_PRO_CI_NODE_INDEX=3
|
|
||||||
- KNAPSACK_PRO_CI_NODE_INDEX=4
|
|
||||||
@@ -33,7 +33,7 @@ If you want to contribute code to solve an issue:
|
|||||||
If you'd like us to review your pull request in good spirits, please follow our coding conventions:
|
If you'd like us to review your pull request in good spirits, please follow our coding conventions:
|
||||||
|
|
||||||
* Include specs to test any changes you've made
|
* Include specs to test any changes you've made
|
||||||
* Travis CI will check whether the rest of the application is still working properly; check its build and make sure all tests are passing
|
* Our CI will check whether the rest of the application is still working properly; check its build and make sure all tests are passing
|
||||||
* Your pull request will be automatically reviewed by Hound CI; fix any issues it reports
|
* Your pull request will be automatically reviewed by Hound CI; fix any issues it reports
|
||||||
* Follow [the seven rules of a great commit message](https://chris.beams.io/posts/git-commit/)
|
* Follow [the seven rules of a great commit message](https://chris.beams.io/posts/git-commit/)
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Cuando quieras resolver una incidencia mediante código:
|
|||||||
Si quieres que revisemos tu código con una sonrisa, por favor sigue nuestras convenciones:
|
Si quieres que revisemos tu código con una sonrisa, por favor sigue nuestras convenciones:
|
||||||
|
|
||||||
* Incluye tests para los cambios que hayas hecho
|
* Incluye tests para los cambios que hayas hecho
|
||||||
* Travis CI comprobará automáticamente que el resto de la aplicación sigue funcionando; asegúrate de que los tests pasan
|
* Los tests se ejecutarán automáticamente para comprobar que el resto de la aplicación sigue funcionando; asegúrate de que los tests pasan
|
||||||
* Tus cambios serán revisados automáticamente por Hound CI; arregla los problemas de los que informa (si es que hay alguno)
|
* Tus cambios serán revisados automáticamente por Hound CI; arregla los problemas de los que informa (si es que hay alguno)
|
||||||
* Sigue [las siete reglas para un gran mensaje de commit](https://chris.beams.io/posts/git-commit/)
|
* Sigue [las siete reglas para un gran mensaje de commit](https://chris.beams.io/posts/git-commit/)
|
||||||
|
|
||||||
|
|||||||
@@ -524,7 +524,7 @@ GEM
|
|||||||
sass-listen (4.0.0)
|
sass-listen (4.0.0)
|
||||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
rb-inotify (~> 0.9, >= 0.9.7)
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
sassc (2.2.1)
|
sassc (2.1.0)
|
||||||
ffi (~> 1.9)
|
ffi (~> 1.9)
|
||||||
sassc-rails (2.1.2)
|
sassc-rails (2.1.2)
|
||||||
railties (>= 4.0.0)
|
railties (>= 4.0.0)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
Citizen Participation and Open Government Application
|
Citizen Participation and Open Government Application
|
||||||
|
|
||||||
[](https://travis-ci.com/consul/consul)
|

|
||||||
[](https://codeclimate.com/github/consul/consul)
|
[](https://codeclimate.com/github/consul/consul)
|
||||||
[](https://coveralls.io/github/consul/consul?branch=master)
|
[](https://coveralls.io/github/consul/consul?branch=master)
|
||||||
[](https://crowdin.com/project/consul)
|
[](https://crowdin.com/project/consul)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
Aplicación de Participación Ciudadana y Gobierno Abierto
|
Aplicación de Participación Ciudadana y Gobierno Abierto
|
||||||
|
|
||||||
[](https://travis-ci.com/consul/consul)
|

|
||||||
[](https://codeclimate.com/github/consul/consul)
|
[](https://codeclimate.com/github/consul/consul)
|
||||||
[](https://coveralls.io/github/consul/consul?branch=master)
|
[](https://coveralls.io/github/consul/consul?branch=master)
|
||||||
[](https://crowdin.com/project/consul)
|
[](https://crowdin.com/project/consul)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
ENV["RAILS_ENV"] ||= "test"
|
ENV["RAILS_ENV"] ||= "test"
|
||||||
if ENV["TRAVIS"]
|
if ENV["COVERALLS"]
|
||||||
require "coveralls"
|
require "coveralls"
|
||||||
Coveralls.wear!("rails")
|
Coveralls.wear!("rails")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -171,5 +171,5 @@ RSpec.configure do |config|
|
|||||||
config.expect_with(:rspec) { |c| c.syntax = :expect }
|
config.expect_with(:rspec) { |c| c.syntax = :expect }
|
||||||
end
|
end
|
||||||
|
|
||||||
# Parallel build helper configuration for travis
|
# Parallel build helper configuration for CI
|
||||||
KnapsackPro::Adapters::RSpecAdapter.bind
|
KnapsackPro::Adapters::RSpecAdapter.bind
|
||||||
|
|||||||
Reference in New Issue
Block a user