-
Notifications
You must be signed in to change notification settings - Fork 3
141 lines (119 loc) · 3.61 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Test
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]
jobs:
checkout:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Zip
run: zip -r repository.zip .
- name: Repository
uses: actions/upload-artifact@v2
with:
name: repository
path: repository.zip
test:
needs: checkout
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php_version:
- "8.0"
- "8.1"
- "8.2"
include:
- php_version: "8.0"
artifact: true
# - php_version: "8.2.0RC3"
# experimental: true
# composer_platform_php: "8.0.24" # Use Latest PHP 8.0
steps:
- name: Checkout
uses: actions/download-artifact@v2
with:
name: repository
- name: Unzip
run: unzip repository.zip && rm -f repository.zip
- name: Prepare
run: |
echo UID=`id -u` >> $GITHUB_ENV
echo GID=`id -g` >> $GITHUB_ENV
- name: Build
run: docker-compose build
env:
PHP_VERSION: ${{ matrix.php_version }}
continue-on-error: ${{ matrix.experimental == true }}
- name: PHP Experimental
if: matrix.experimental == true
run: |
docker-compose run romans composer config platform.php ${{ matrix.composer_platform_php }}
docker-compose run romans composer update --lock --no-install
git diff composer.json composer.lock
continue-on-error: ${{ matrix.experimental == true }}
- name: Install
run: docker-compose run romans composer install
continue-on-error: ${{ matrix.experimental == true }}
- name: Test
run: docker-compose run -e COVERAGE_OPTIONS romans composer test
env:
COVERAGE_OPTIONS: --coverage-text --coverage-html build/coverage --coverage-clover build/coverage.xml
continue-on-error: ${{ matrix.experimental == true }}
- name: Package
run: docker-compose run romans composer archive --dir build --format zip --file package
continue-on-error: ${{ matrix.experimental == true }}
- name: Package Check
run: ./.github/bin/package-check.sh
continue-on-error: ${{ matrix.experimental == true }}
- name: Clean
run: docker-compose down
if: always()
- name: Zip
run: zip -r repository.zip .
if: matrix.artifact == true
- name: Repository
uses: actions/upload-artifact@v2
if: matrix.artifact == true
with:
name: repository
path: repository.zip
reports:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/download-artifact@v2
with:
name: repository
- name: Unzip
run: unzip repository.zip && rm -f repository.zip
- name: Coverage
uses: actions/upload-artifact@v2
with:
name: coverage
path: build/coverage/
- name: Package
uses: actions/upload-artifact@v2
with:
name: package
path: build/package.zip
- name: Codecov
run: |
curl https://uploader.codecov.io/latest/linux/codecov \
--silent --remote-name
chmod +x codecov
./codecov --token "${{ secrets.CODECOV_TOKEN }}"
if: github.ref == 'refs/heads/main'
clean:
needs: reports
runs-on: ubuntu-latest
steps:
- name: Clean
uses: geekyeggo/delete-artifact@v1
with:
name: repository