-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (41 loc) · 1.02 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Test Runner EW
on:
push:
paths:
- '**.js'
- '**.json'
- '**.yml'
branches:
- main
jobs:
setup-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Compose
run: |
sudo rm -f /usr/local/bin/docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /tmp/docker-compose
chmod +x /tmp/docker-compose
sudo mv /tmp/docker-compose /usr/local/bin/docker-compose
- name: Start MongoDB
run: |
cd ./app
docker-compose up -d mongodb
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Restore dependencies
run: |
cd ./app
npm ci
- name: Run tests
run: |
cd ./app
npm test
- name: Clean up
run: |
cd ./app
docker-compose down --volumes