Skip to content

Commit 0f8a500

Browse files
authored
Merge pull request #1 from perfetti/building_workflow
adding a test workflow
2 parents 07cbdc7 + b93610b commit 0f8a500

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/test.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
env:
12+
GH_TOKEN: "${{secrets.GH_TOKEN}}"
13+
14+
FRONTEND_REPO_URL: "github.com/perfetti/react1-app.git"
15+
BACKEND_REPO_URL: "github.com/perfetti/react2-app.git"
16+
API_REPO_URL: "github.com/perfetti/rails-app.git"
17+
18+
FRONTEND_REF: "main"
19+
BACKEND_REF: "main"
20+
API_REF: "main"
21+
22+
FRONTEND_PUBLIC_URL: "//localhost:8089/"
23+
BACKEND_PUBLIC_URL: "//localhost:8089/backend/"
24+
WDS_SOCKET_PORT: "8089"
25+
26+
POSTGRES_USER: "postgres"
27+
POSTGRES_PASSWORD: "postgres"
28+
POSTGRES_DB: "perfetti"
29+
30+
RAILS_HOST: "api"
31+
RAILS_ENV: "test"
32+
DATABASE_HOST: "db"
33+
DATABASE_USERNAME: "postgres"
34+
RAILS_RELATIVE_URL_ROOT: "/api"
35+
36+
jobs:
37+
test:
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v2
43+
44+
- name: Build and start Docker Compose services
45+
run: docker-compose -f compose.yaml up --build -d
46+
47+
- name: Run tests inside Docker container
48+
run: cd tests && npm run test:docker
49+
50+
- name: Tear down Docker Compose services
51+
run: docker-compose down

0 commit comments

Comments
 (0)