This commit is contained in:
parent
fca7a440db
commit
6b314812b9
1 changed files with 70 additions and 0 deletions
70
.github/workflows/build.yml
vendored
Normal file
70
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# This workflow will build and test the Rails application
|
||||
|
||||
name: Build and Test Rails Application
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:latest
|
||||
env:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: debshots_test
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 3.4.7
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
gem install bundler
|
||||
bundle install
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install -g yarn
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
run: yarn install
|
||||
|
||||
- name: Set up database
|
||||
run: |
|
||||
bundle exec rails db:create db:migrate
|
||||
env:
|
||||
RAILS_ENV: test
|
||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/debshots_test
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rails test
|
||||
env:
|
||||
RAILS_ENV: test
|
||||
DATABASE_URL: postgres://postgres:postgres@localhost:5432/debshots_test
|
||||
|
||||
- name: Build assets
|
||||
run: bundle exec rails assets:precompile
|
||||
env:
|
||||
RAILS_ENV: production
|
||||
Loading…
Add table
Add a link
Reference in a new issue