Add file upload from Box (IR-30) #1121
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: CI | |
on: [push] | |
jobs: | |
build: | |
name: Test in Ubuntu | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:12-alpine | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_DB: ideals | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- name: Install system dependencies | |
run: sudo apt-get -y install build-essential libmagic-dev libpq-dev curl | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
- name: Prepare the configuration | |
run: cp config/credentials/ci.yml config/credentials/test.yml | |
- name: Install Ruby | |
# This will install the version specified in `.ruby-version` | |
uses: eregon/use-ruby-action@master | |
- name: Install gems | |
run: | | |
gem install bundler | |
bundle config path vendor/bundle | |
bundle config set without "production" | |
bundle install --jobs 4 --retry 3 | |
- name: Prepare the database | |
env: | |
RAILS_ENV: test | |
SECRET_KEY_BASE: whateverdoesntmatter | |
run: bin/rails db:prepare | |
- name: Run the tests | |
env: | |
RAILS_ENV: test | |
SECRET_KEY_BASE: whateverdoesntmatter | |
# N.B. 1: Ideally we would run Elasticsearch in a service like we do | |
# PostgreSQL above, but we need to use a plugin that isn't included in | |
# ES's standard Dockerfile. So instead we have to build a custom image | |
# and run it in this step. We can't do it in an earlier step because | |
# processes don't live through steps. | |
# | |
# N.B. 2: Similar story with Minio; the official Dockerfile requires | |
# supplying some extra arguments but GitHub Actions services don't | |
# support this. | |
run: | | |
docker build -t ideals-elasticsearch -f .github/Dockerfile-elasticsearch . | |
docker run -d -p 9200:9200 -e "discovery.type=single-node" ideals-elasticsearch | |
docker run -d -p 9000:9000 -e MINIO_ACCESS_KEY=my-access-key -e MINIO_SECRET_KEY=my-secret-key minio/minio:latest server /data | |
sleep 30 | |
bin/rails "elasticsearch:indexes:create[ideals_test]" | |
bin/rails test | |
# TODO: Rails 6.0.2 has a bug that causes this to fail. Enable it once migrated to rails 6.0.3. | |
#- name: Check class names | |
# run: bin/rails zeitwerk:check |