-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (73 loc) · 2.58 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
82
83
84
85
86
87
name: Framelix Unit Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
framelix-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout framelix repository
uses: actions/checkout@v3
- name: Create .env file
run: cp dev-scripts/.env_git_tests dev-scripts/.env
- name: Start docker container
run: bash dev-scripts/start-container.sh
- name: Install dependencies
run: bash dev-scripts/run-tests.sh -t install-deps
- name: Run PhpStan Static Analysis
run: bash dev-scripts/run-tests.sh -t phpstan
- name: Run Playwright tests
run: bash dev-scripts/run-tests.sh -t playwright && echo "MESSAGE=$(cat userdata/playwright/badge-message.txt)" >> $GITHUB_ENV && echo "COLOR=$(cat userdata/playwright/badge-color.txt)" >> $GITHUB_ENV
- name: Upload userdata after playwright tests to GitHub
if: always()
uses: actions/upload-artifact@v3
with:
name: userdata-after-playwright
path: ./userdata
retention-days: 5
- name: Run PHP Unit Tests
run: bash dev-scripts/run-tests.sh -t phpunit && echo "COVERAGE=$(cat userdata/clover-coverage.txt)" >> $GITHUB_ENV
- name: Upload userdata after phpunit tests to GitHub
if: always()
uses: actions/upload-artifact@v3
with:
name: userdata-after-phpunit
path: ./userdata
retention-days: 5
- name: Create Playwright Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 91cdcb4629cfb14f8c00ab5ea4e485ec
filename: framelix-playwright-tests.json
label: 'Playwright Tests'
message: ${{ env.MESSAGE }}
color: ${{ env.COLOR }}
- name: Create PHP Coverage Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 2e4ba189fbb1a23bff14e73cb893bc3e
filename: framelix-unit-tests-coverage-data.json
label: CodeCoverage
message: ${{ env.COVERAGE }}
color: orange
- name: Dump docker logs
if: always()
uses: jwalton/gh-docker-logs@v2
with:
dest: './logs'
- name: Upload docker logs to GitHub
if: always()
uses: actions/upload-artifact@v3
with:
name: docker-logs
path: ./logs
retention-days: 5
- name: Stop containers
if: always()
run: bash dev-scripts/stop-container.sh