-
-
Notifications
You must be signed in to change notification settings - Fork 401
81 lines (65 loc) · 1.93 KB
/
automation-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: Automation Tests
on:
push:
branches: [ develop, feature/** ]
pull_request:
branches: [ develop ]
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
automation-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- uses: actions/setup-node@v2
with:
node-version: '18'
- uses: actions/cache@v2
with:
path: |
'**/node_modules'
'/home/runner/.cache/Cypress'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Frontend Deps
run: yarn --cwd ./src/Ombi/ClientApp install
- name: Build Frontend
run: yarn --cwd ./src/Ombi/ClientApp build
- name: Build Docker Image
run: docker build -t ombi src/
- name: Run Docker Image
run: nohup docker run --rm -p 5000:5000 ombi &
- name: Run Wiremock
run: nohup docker run --rm -p 32400:8080 --name wiremock wiremock/wiremock:2.35.0 &
- name: Sleep for server to start
run: sleep 20
# - name: Start Frontend
# run: |
# nohup yarn --cwd ./src/Ombi/ClientApp start &
# - name: Install Automation Deps
# run: yarn --cwd ./tests install
# - name: Start Backend
# run: |
# nohup dotnet run --project ./src/Ombi -- --host http://*:3577 &
- name: Cypress Tests
uses: cypress-io/github-action@v4
with:
record: true
browser: chrome
headless: true
working-directory: tests
wait-on: http://localhost:5000/
# 10 minutes
wait-on-timeout: 600
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Stop Docker
if: always()
run: |
docker ps -q | xargs -I {} docker logs {}
docker container kill $(docker ps -q)