removing heroku release phase since it no longer has git #1213
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
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake | |
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | |
name: rails test | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: postgres:11 | |
ports: ["5432:5432"] | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
POSTGRES_USER: vhp | |
POSTGRES_DB: vhp_test | |
POSTGRES_PASSWORD: "abcdefg" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: rm Gemfile.lock | |
run: | | |
rm -f Gemfile.lock | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.0 | |
bundler-cache: true | |
- name: Install PostgreSQL 11 client | |
run: | | |
sudo apt-get -yqq install libpq-dev | |
- name: Use test config | |
run: | | |
cp config/database.github.yml config/database.yml | |
- name: Clone vhp-writing | |
run: | | |
git clone https://github.com/VulnerabilityHistoryProject/vhp-writing.git tmp/checkout/vhp-writing | |
- name: Setup test database | |
env: | |
RAILS_ENV: test | |
PGHOST: localhost | |
PGUSER: vhp | |
run: | | |
bundle exec rails db:create db:schema:load | |
- name: Run tests | |
env: | |
RAILS_ENV: test | |
PGHOST: localhost | |
PGUSER: vhp | |
run: | | |
bundle exec rails test |