generated from yandex-praktikum/middle.messenger.praktikum.yandex
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.64 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
name: Tests
on:
pull_request:
branches:
- main
jobs:
test:
if: ${{github.head_ref == 'sprint_1' || github.head_ref == 'sprint_2' || github.head_ref == 'sprint_3' || github.head_ref == 'sprint_4'}}
env:
SPRINT: ${{github.head_ref}}
TERM: xterm-256color
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Set up GitHub Actions
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Сheck if the repository is private
if: ${{github.event.repository.private}}
run: exit 1
- name: Install testing libs
uses: mig4/setup-bats@v1
- name: Get testing lib
run: set -eu && git clone https://github.com/Yandex-Practicum/tests-middle-frontend.git /tmp/tests-middle-frontend
- name: Run tests (sprint_1)
if: ${{github.head_ref >= 'sprint_1'}}
run: bats --formatter pretty /tmp/tests-middle-frontend/tests/sprint_1.bats
- name: Run tests (sprint_2)
if: ${{github.head_ref >= 'sprint_2'}}
run: bats --formatter pretty /tmp/tests-middle-frontend/tests/sprint_2.bats
- name: Run tests (sprint_3)
if: ${{github.head_ref >= 'sprint_3'}}
run: bats --formatter pretty /tmp/tests-middle-frontend/tests/sprint_3.bats
- name: Run tests (sprint_4)
if: ${{github.head_ref >= 'sprint_4'}}
run: bats --formatter pretty /tmp/tests-middle-frontend/tests/sprint_4.bats
- name: Run tests (server)
run: bats --formatter pretty /tmp/tests-middle-frontend/tests/node_build.bats