Improve custom pages specs #321
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches-ignore: | |
- i18n_master | |
permissions: | |
contents: read | |
env: | |
TEST_COVERAGE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && 1 || '' }} | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
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 | |
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: | |
CI_NODE_TOTAL: ${{ matrix.ci_node_total }} | |
CI_NODE_INDEX: ${{ matrix.ci_node_index }} | |
run: bundle exec rake knapsack:rspec | |
- name: Coveralls Parallel | |
if: ${{ env.TEST_COVERAGE == 1 }} | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
flag-name: run-${{ matrix.ci_node_index }} | |
parallel: true | |
- name: Upload screenshots | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: screenshots | |
path: tmp/screenshots | |
coveralls: | |
permissions: | |
contents: none | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: Finish coveralls | |
if: ${{ env.TEST_COVERAGE == 1 }} | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true |