This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
Merge pull request #1227 from alphagov/log-dataset-errors #290
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
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:9.5 | |
env: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | |
env: | |
RAILS_ENV: test | |
REDIS_URL: redis://localhost:6379/0 | |
DATABASE_URL: postgresql://postgres@localhost/publish_data_beta_test | |
steps: | |
- name: Configure sysctl limits | |
run: | | |
sudo swapoff -a | |
sudo sysctl -w vm.swappiness=1 | |
sudo sysctl -w fs.file-max=262144 | |
sudo sysctl -w vm.max_map_count=262144 | |
- uses: ankane/setup-opensearch@v1 | |
with: | |
opensearch-version: 1.2 | |
host port: 9200 | |
container port: 9200 | |
host node port: 9300 | |
node port: 9300 | |
discovery type: 'single-node' | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
- uses: actions/cache@v1 | |
with: | |
path: vendor/bundle | |
key: bundle-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: bundle | |
- run: bundle install --jobs 4 --retry 3 --deployment | |
- name: Setup database | |
env: | |
RAILS_ENV: test | |
DATABASE_URL: postgresql://postgres@localhost/publish_data_beta_test | |
run: bundle exec rails db:create | |
- run: bundle exec rails db:schema:load | |
- name: Run tests | |
run: bundle exec rake |