Skip to content

Commit

Permalink
Run frontend tests on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
anarute committed Sep 27, 2023
1 parent db990be commit fd49110
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 35 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build containers
run: docker build -t igalia/phpreport -f docker/test.app.Dockerfile .
- name: Run the containers
run: docker-compose -f ./docker/docker-compose.test.yml up -d
- name: Wait
run: sleep 15s
- name: Run tests
run: docker exec -t phpreport-app ./vendor/bin/phpunit --testdox tests --verbose
- name: Run flake8 check
run: docker exec -t phpreport-app tox -c api/tox.ini -e flake8
run: docker exec -t phpreport-api tox -e flake8
- name: Run black check
run: docker exec -t phpreport-app tox -c api/tox.ini -e black
run: docker exec -t phpreport-api tox -e black
- name: Run jest
run: docker exec -t phpreport-frontend npm run test
45 changes: 35 additions & 10 deletions docker/docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,47 @@
version: '3'
services:
db:
build:
context: ../
dockerfile: docker/test.db.Dockerfile
container_name: phpreport-db
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: phpreport
POSTGRES_USER: phpreport
POSTGRES_DB: phpreport
phpreport-app:
build:
context: ../
dockerfile: docker/test.app.Dockerfile
image: igalia/phpreport
dockerfile: docker/dev.app.Dockerfile
env_file:
- ../.env.test
container_name: phpreport-app
restart: always
command: bash -c "cp .env.test .env && php -S 0.0.0.0:8000"
ports:
- '8000:8000'
- "8000:8000"
depends_on:
- db
db:
api:
build:
context: ../
dockerfile: docker/test.db.Dockerfile
dockerfile: docker/dev.api.Dockerfile
container_name: phpreport-api
env_file:
- ../.env.test
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: phpreport
POSTGRES_USER: phpreport
- "8555:8555"
depends_on:
- db
frontend:
build:
context: ../
dockerfile: docker/dev.frontend.Dockerfile
container_name: phpreport-frontend
env_file:
- ../frontend/.env.example
ports:
- "5173:5173"
depends_on:
- api
21 changes: 0 additions & 21 deletions docker/test.app.Dockerfile

This file was deleted.

0 comments on commit fd49110

Please sign in to comment.