Skip to content

Commit

Permalink
config: #6 update github test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianrbp committed Aug 8, 2024
1 parent 001406a commit c52a6eb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ jobs:
backend:
name: 'Rails API Tests'
runs-on: ubuntu-latest

services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres_user
POSTGRES_PASSWORD: testpassword
POSTGRES_DB: monitoring_sys_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -18,12 +34,26 @@ jobs:
- name: Install dependencies
run: |
cd backend
gem install bundler
bundle install
- name: Run Rails tests
- name: Set up environment variables
run: |
echo "DATABASE_HOST=localhost" >> $GITHUB_ENV
echo "DATABASE_USER=postgres_user" >> $GITHUB_ENV
echo "DATABASE_PASSWORD=testpassword" >> $GITHUB_ENV
- name: Set up database
run: |
cd backend
RAILS_ENV=test rails db:create
RAILS_ENV=test rails db:migrate
RAILS_ENV=test rails db:seed
- name: Run RSpec tests
run: |
cd backend
bundle exec rspec
RAILS_ENV=test bundle exec rspec
frontend:
name: 'Vue Frontend Tests'
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@
- abrir command palette: ctrl + shift + p
- Seleccionar: Reopen in container
- Seleccionar: "Rails API Container"
- Dentro ejecutar: `rails s`
- Dentro ejecutar: `rails s -b 0.0.0.0`
- Ejecutar el contenedor Vue Container:
- abrir command palette: ctrl + shift + p
- Seleccionar: Reopen in container
- Seleccionar: "Vue Container"
- Dentro ejecutar: `yarn dev`
- Dentro ejecutar mocked: `yarn dev`
- Dentro ejecutar api: `yarn serve:api`
- navegar a 0.0.0.0:8080 para empezar a usar la app
- Ejecutar tests e2e:
```bash
Expand Down

0 comments on commit c52a6eb

Please sign in to comment.