Skip to content

Fix no rain graph

Fix no rain graph #301

Workflow file for this run

name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
environment: test
services:
db:
image: postgres:15
env:
POSTGRES_USER: wrp
POSTGRES_PASSWORD: dev
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/Gemfile
BUNDLE_BUILD__SASSC: "--disable-march-tune-native"
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Ruby & Bundle Install
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.4'
bundler-cache: true
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20.13.1
- name: Configure Yarn Cache Location
id: cache-locations
run: |
echo "yarn_dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Check Yarn Cache
id: cache-yarn
uses: actions/cache@v3
with:
path: ${{ steps.cache-locations.outputs.yarn_dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install Javascript Packages
run: |
NODE_OPTIONS=--openssl-legacy-provider yarn install --pure-lockfile
- name: Compile Assets
env:
RAILS_ENV: test
run: |
NODE_OPTIONS=--openssl-legacy-provider bundle exec rails webpacker:compile
- name: Create Database
env:
POSTGRES_TEST_DB: wetrockpolice_test
POSTGRES_USER: wrp
POSTGRES_PASSWORD: dev
POSTGRES_HOST: localhost
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: |
bundle exec rake db:create
bundle exec rake db:migrate
- name: Run Tests
env:
POSTGRES_TEST_DB: wetrockpolice_test
POSTGRES_USER: wrp
POSTGRES_PASSWORD: dev
POSTGRES_HOST: localhost
RAILS_ENV: test
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
bundle exec rails test