-
Notifications
You must be signed in to change notification settings - Fork 25
88 lines (85 loc) · 3.01 KB
/
Copy pathtests.yml
File metadata and controls
88 lines (85 loc) · 3.01 KB
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
88
name: Tests
on:
push:
pull_request:
workflow_dispatch:
jobs:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: xdebug
- run: composer install --no-interaction
- run: composer dump-autoload
- run: |
if [ -d src ]; then vendor/bin/phpcs --standard=PSR12 src/; else echo "→ Skip (src/ not yet present)"; fi
- run: |
if [ -d src ]; then vendor/bin/phpstan analyse src/ --level=max; else echo "→ Skip (src/ not yet present)"; fi
- run: |
if [ -d test/Unit ]; then XDEBUG_MODE=coverage vendor/bin/phpunit --testsuite=unit --display-skipped --log-junit junit.xml; else echo "→ Skip (test/Unit/ not yet present)"; fi
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: unit-test-results
path: |
junit.xml
build/coverage/
if-no-files-found: ignore
integration:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: zammad/zammad-ci:latest
services:
postgresql:
image: postgres:17
env:
POSTGRES_USER: zammad
POSTGRES_PASSWORD: zammad
redis:
image: redis:7
steps:
- uses: actions/checkout@v7
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: xdebug
- name: Install dependencies
run: composer install --no-interaction
- name: Dump autoload
run: composer dump-autoload
- name: Set up Zammad
shell: bash
run: |
git clone --depth 1 https://github.com/zammad/zammad.git
cd zammad
source /etc/profile.d/rvm.sh
bundle config set --local frozen 'true'
bundle config set --local path 'vendor'
bundle install -j $(nproc)
bundle exec ruby .gitlab/configure_environment.rb
source .gitlab/environment.env
RAILS_ENV=test bundle exec rake db:create
RAILS_ENV=test bundle exec rake zammad:ci:test:start zammad:setup:auto_wizard
- name: Run integration tests
run: |
set -x
if [ -d test/Integration ]; then XDEBUG_MODE=coverage vendor/bin/phpunit --testsuite=integration --group=integration --display-skipped --log-junit junit-integration.xml; else echo "→ Skip (test/Integration/ not yet present)"; fi
env:
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_URL: http://localhost:3000/api/v1
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_USERNAME: admin@example.com
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD: test
- name: Upload integration test artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: integration-test-results
path: |
junit-integration.xml
coverage-integration.xml
if-no-files-found: ignore