This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (77 loc) · 2.36 KB
/
test.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
name: Test
on:
pull_request:
push:
workflow_dispatch:
env:
COMPOSER_CACHE_DIR: /tmp/_composer_cache
jobs:
unit-tests:
name: Tests for php${{ matrix.php-versions }}
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
steps:
- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype,curl,dom,gd,iconv,intl,json,mbstring,openssl,posix,sqlite,xml,zip,gmp
coverage: xdebug
- name: Checkout code
uses: actions/checkout@v4
- name: Cache composer cache directory
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: composer-cache
- name: Unit tests
run: |
composer install
composer test
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: ctype,curl,dom,gd,iconv,intl,json,mbstring,openssl,posix,sqlite,xml,zip,gmp
coverage: xdebug
- name: Checkout code
uses: actions/checkout@v4
- name: Cache composer cache directory
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: composer-cache
- name: Unit tests
run: |
composer install
result=0
composer run cs || result=1
composer run phpstan || result=1
composer run psalm || result=1
exit $result
# deploy:
# runs-on: ubuntu-latest
# needs: [unit-tests, linting]
# if: github.ref == 'refs/heads/main'
# environment: ${{ github.ref_name }}
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
#
# - name: Deploy and wait for completion
# if: github.ref == 'refs/heads/main'
# uses: digital-blueprint/gitlab-pipeline-trigger-action@v1
# with:
# host: 'gitlab.tugraz.at'
# trigger_token: ${{ secrets.DEPLOY_TRIGGER_TOKEN }}
# access_token: ${{ secrets.DEPLOY_ACCESS_TOKEN }}
# id: '21238'
# ref: 'main'
# variables: '{"UPSTREAM_PROJECT_PATH":"dbp/relay/dbp-relay-server-template","UPSTREAM_COMMIT_BRANCH":"${{ github.ref_name }}","UPSTREAM_COMMIT_SHA":"${{ github.ref_name }}"}'