Updates for 08/15/24 #62
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: .github/workflows/tests.yml | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
# | |
# | |
# Unit Tests | |
# | |
# | |
tests: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Setup Chrome | |
uses: browser-actions/setup-chrome@latest | |
with: | |
chrome-version: stable | |
- name: Install PostgreSQL client and chrome | |
run: | | |
sudo apt-get -yqq install libpq-dev google-chrome-stable | |
- name: Db Setup | |
env: | |
PGHOST: localhost | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
RAILS_ENV: test | |
run: | | |
bin/rails db:setup | |
- name: bundle and yarn | |
env: | |
PGHOST: localhost | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
RAILS_ENV: test | |
run: | | |
bundle install && yarn install && yarn build:css && yarn build | |
- name: Tests | |
env: | |
PGHOST: localhost | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
RAILS_ENV: test | |
run: | | |
./bin/rails test:all | |
# | |
# | |
# Rubocop | |
# | |
# | |
rubocop: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
- name: Run rubocop | |
run: | | |
gem install rubocop | |
rubocop app/ | |
# | |
# | |
# Reek | |
# | |
# | |
reek: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
- name: Run Reek | |
run: | | |
gem install reek | |
reek app/ |