generated from yandex-praktikum/react-mesto-api-full-gha
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (78 loc) · 2.52 KB
/
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Tests 15 sprint
on:
push:
branches:
- '**'
tags:
- '**'
jobs:
test_config:
runs-on: ubuntu-latest
steps:
- name: Set up GitHub Actions
uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Сheck if the repository is private
run: exit 1
if: ${{github.event.repository.private}}
- name: Get testing lib
run: set -eu && git clone --branch master --single-branch --depth 1 https://github.com/Yandex-Practicum/web-autotest-public.git
- name: Copy Makefile
run: cp ./web-autotest-public/Makefile ./Makefile
- name: Installing Dependencies
run: cd backend&&npm i
- name: Cache test dependencies
id: cache
uses: actions/cache@v3
with:
path: ./web-autotest-public
key: modules-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install test dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install -g [email protected]
pnpm i --fix-lockfile --prefix web-autotest-public/
- name: Run test config
run: make proj15-test-config
test_endpoints:
runs-on: ubuntu-latest
steps:
- name: Set up GitHub Actions
uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Сheck if the repository is private
run: exit 1
if: ${{github.event.repository.private}}
- name: Get testing lib
run: set -eu && git clone --branch master --single-branch --depth 1 https://github.com/Yandex-Practicum/web-autotest-public.git
- name: Copy Makefile
run: cp ./web-autotest-public/Makefile ./Makefile
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: '4.4'
- name: Installing Dependencies
run: cd backend&&npm i
- name: Installing wait-port
run: npm install -g wait-port
- name: Run server
run: npm --prefix backend/ run start & wait-port -t 30000 localhost:3000
- name: Cache test dependencies
id: cache
uses: actions/cache@v3
with:
path: ./web-autotest-public
key: modules-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install test dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install -g [email protected]
pnpm i --fix-lockfile --prefix web-autotest-public/
- name: Run test endpoints
run: make proj15-test-endpoints