-
Notifications
You must be signed in to change notification settings - Fork 8
92 lines (72 loc) · 1.98 KB
/
ci.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
88
89
90
91
92
name: CI and release
on:
push:
branches:
- master
- development
tags:
- 'v*.*.*'
pull_request:
schedule:
- cron: "7 7 * * *"
jobs:
static-analysis:
runs-on: ubuntu-latest
steps:
- name: GIT--checkout
uses: actions/checkout@v4
- name: Install tools for static analysis
run: make install-static-analysis
- name: Composer validate
run: make composer-validate
- name: Composer validate
run: make composer-install
- name: Run PHPStan
run: make phpstan
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
steps:
- name: GIT--checkout
uses: actions/checkout@v4
- name: Install environment
run: make composer-install
- name: Run all tests
run: make -s "test-php-${{matrix.php}}"
env:
COMPOSE_INTERACTIVE_NO_CLI: 1
release:
needs:
- static-analysis
- tests
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: GIT--Checkout
uses: actions/checkout@v4
- name: Extract version
if: success()
run: |
# Strip git ref prefix from version
RELEASE_VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && RELEASE_VERSION=$(echo $RELEASE_VERSION | sed -e 's/^v//')
echo $RELEASE_VERSION
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
- name: Create release
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v1
with:
name: Version ${{ env.RELEASE_VERSION }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}