Skip to content

Commit 554bc74

Browse files
committed
change test flow
1 parent 8027a86 commit 554bc74

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

.github/workflows/create-release.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,11 @@ env:
1010
IMAGE_NAME: samacommunity/sama-server
1111

1212
jobs:
13-
run_tests:
14-
if: |
15-
contains(github.event.pull_request.title, 'release') == true &&
16-
github.event.pull_request.merged == true &&
17-
github.event.pull_request.base.ref == 'main'
18-
runs-on: self-hosted
19-
steps:
20-
- uses: actions/checkout@v3
21-
- name: Build the SAMA resources
22-
run: docker compose -f docker-compose-full.yml up -d --build
23-
24-
- name: Run migrations
25-
run: docker compose exec sama-server sh -c "MONGODB_URL=mongodb://172.25.0.4/samatests npm run migrate-mongo-up"
26-
27-
- name: Run tests
28-
run: docker compose exec sama-server sh -c "MONGODB_URL=mongodb://172.25.0.4/samatests npm run test"
29-
30-
- name: Stop the SAMA resources
31-
run: docker compose -f docker-compose-full.yml down -v --rmi all
32-
3313
create-release:
3414
if: |
3515
contains(github.event.pull_request.title, 'release') == true &&
3616
github.event.pull_request.merged == true &&
3717
github.event.pull_request.base.ref == 'main'
38-
needs: [run_tests]
3918
runs-on: self-hosted
4019

4120
steps:

.github/workflows/tests.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Docker Compose Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
run_tests:
10+
runs-on: self-hosted
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Build the SAMA resources
14+
run: docker compose -f docker-compose-full.yml up -d --build
15+
16+
- name: Run migrations
17+
run: docker compose exec sama-server sh -c "MONGODB_URL=mongodb://172.25.0.4/samatests npm run migrate-mongo-up"
18+
19+
- name: Run tests
20+
run: docker compose exec sama-server sh -c "MONGODB_URL=mongodb://172.25.0.4/samatests npm run test"
21+
22+
- name: Stop the SAMA resources
23+
run: docker compose -f docker-compose-full.yml down -v --rmi all

0 commit comments

Comments
 (0)