Skip to content

Commit fa3f995

Browse files
committed
update unitest setup & github workflows
1 parent 198f3c4 commit fa3f995

23 files changed

+390
-65
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ jobs:
2929
operating-system: ['ubuntu-20.04']
3030
php-versions: ['7.4', '8.0', 'latest']
3131
phpunit-versions: ['latest', '9.5']
32+
exclude:
33+
- php-versions: '7.4'
34+
phpunit-versions: 'latest'
35+
- php-versions: '8.0'
36+
phpunit-versions: 'latest'
3237
steps:
3338
- name: Setup github ssh key
3439
run: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com > ~/.ssh/known_hosts
@@ -48,9 +53,7 @@ jobs:
4853
- name: Install horde/test dependency and other dependencies
4954
run: |
5055
## For unclear reasons, github action fails randomly if we do not install before we require.
56+
COMPOSER_ROOT_VERSION=dev-FRAMEWORK_6_0 composer config minimum-stability dev
5157
COMPOSER_ROOT_VERSION=dev-FRAMEWORK_6_0 composer install
52-
COMPOSER_ROOT_VERSION=dev-FRAMEWORK_6_0 composer require --dev horde/test dev-FRAMEWORK_6_0 horde/log dev-FRAMEWORK_6_0
53-
- name: install horde/db ^3
54-
run: composer require horde/db ^3
5558
- name: run phpunit
56-
run: phpunit --bootstrap test/Horde/Auth/bootstrap.php test/Horde/Auth/
59+
run: phpunit --bootstrap test/bootstrap.php

.github/workflows/phpdoc.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup PHP
4141
uses: shivammathur/setup-php@v2
4242
with:
43-
php-version: 7.4
43+
php-version: '8.1'
4444
extensions: bcmath, ctype, curl, dom, gd, gettext, iconv, imagick, json, ldap, mbstring, mysql, opcache, openssl, pcntl, pdo, posix, redis, soap, sockets, sqlite, tokenizer, xmlwriter
4545
ini-values: post_max_size=512M, max_execution_time=360
4646
coverage: xdebug
@@ -60,7 +60,8 @@ jobs:
6060
echo "Creating UUT related dir in docu repo"
6161
mkdir -p $UUT_DIR/phpdoc-git/${GITHUB_REF##*/}/${REPO}/
6262
## Look into any of lib, src, app (if they exist) but not test, migration, bin, locale or script dirs
63-
$BIN_DIR/phpdocumentor -d $UUT_DIR/lib/ -d $UUT_DIR/src/ -d $UUT_DIR/app/ -t "${UUT_DIR}/phpdoc-git/${GITHUB_REF##*/}/${REPO}/"
63+
cd $UUT_DIR
64+
$BIN_DIR/phpdocumentor -d lib/ -d src/ -d app/ -t "phpdoc-git/${GITHUB_REF##*/}/${REPO}/"
6465
cd ${UUT_DIR}/phpdoc-git
6566
git add "${GITHUB_REF##*/}/${REPO}"
6667
php indexer.php ${GITHUB_REF##*/} $REPO

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
name: make release
3+
4+
# manual workflow to make a new release for the default branch
5+
on:
6+
workflow_dispatch:
7+
branches:
8+
- FRAMEWORK_6_0
9+
env:
10+
components: "/home/runner/.composer/web/components/bin/horde-components -c /home/runner/.composer/web/components/config/maintaina.conf.dist"
11+
COMPOSER_ALLOW_SUPERUSER: 1
12+
13+
jobs:
14+
run:
15+
runs-on: ${{ matrix.operating-system }}
16+
strategy:
17+
matrix:
18+
operating-system: ['ubuntu-20.04']
19+
php-versions: ['8.1']
20+
steps:
21+
- name: Setup git
22+
run: |
23+
mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com > ~/.ssh/known_hosts
24+
git config --global user.name "Github CI Runner"
25+
git config --global user.email "[email protected]"
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
with:
29+
fetch-depth: 0
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php-versions }}
34+
extensions: gettext
35+
ini-values: post_max_size=512M, max_execution_time=360
36+
tools: composer:v2
37+
- name: Setup composer
38+
run: |
39+
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
40+
composer global config repositories.0 composer https://horde-satis.maintaina.com
41+
composer global config minimum-stability dev
42+
composer config --no-plugins --global allow-plugins.horde/horde-installer-plugin true
43+
composer global require horde/horde-installer-plugin "2.3.0"
44+
composer global require horde/components "dev-FRAMEWORK_6_0"
45+
- name: write changelog
46+
run: |
47+
entries_amount=0; max_entries=100
48+
PATTERN="^\[.*\] .*"
49+
50+
for commit in $(git rev-list FRAMEWORK_6_0)
51+
do
52+
msg=$(git log --format=%B -n 1 $commit | head -n 1)
53+
if [ $entries_amount -gt $max_entries ]; then break; fi
54+
if [[ $msg == 'Released'* ]]; then break; fi
55+
if [[ $msg == 'Development mode for'* ]]; then break; fi
56+
if [[ $msg =~ $PATTERN ]]; then
57+
$components changed "$msg"
58+
let "entries_amount+=1"
59+
fi
60+
done
61+
- name: make release and push
62+
run: |
63+
$components release for maintaina
64+
git push
65+
git push origin --tags

.github/workflows/update-satis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Setup PHP
3939
uses: shivammathur/setup-php@v2
4040
with:
41-
php-version: 7.4
41+
php-version: '8.2'
4242
extensions: bcmath, ctype, curl, dom, gd, gettext, iconv, imagick, json, ldap, mbstring, mysql, opcache, openssl, pcntl, pdo, posix, redis, soap, sockets, sqlite, tokenizer, xmlwriter
4343
ini-values: post_max_size=512M, max_execution_time=3600
4444
coverage: xdebug

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ run-tests.log
2727
/test/*/*/*/*.log
2828
/test/*/*/*/*.out
2929

30+
/vendor
31+
/composer.lock
32+
/web
33+
/.phpunit.cache
34+
.phpunit.results.cache
35+
.php-cs-fixer.cache

.horde.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ dependencies:
5555
horde/ldap: ^3
5656
horde/imsp: ^3
5757
horde/http: ^3
58-
horde/test: ^3
5958
ext:
6059
ctype: '*'
6160
ftp: '*'
6261
pam: '*'
6362
sasl: '*'
63+
dev:
64+
composer:
65+
horde/test: ^3

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
"horde/util": "^3 || dev-FRAMEWORK_6_0",
3737
"ext-hash": "*"
3838
},
39-
"require-dev": {},
39+
"require-dev": {
40+
"horde/test": "^3 || dev-FRAMEWORK_6_0"
41+
},
4042
"suggest": {
4143
"horde/db": "^3 || dev-FRAMEWORK_6_0",
4244
"horde/history": "^3 || dev-FRAMEWORK_6_0",
@@ -46,7 +48,6 @@
4648
"horde/ldap": "^3 || dev-FRAMEWORK_6_0",
4749
"horde/imsp": "^3 || dev-FRAMEWORK_6_0",
4850
"horde/http": "^3 || dev-FRAMEWORK_6_0",
49-
"horde/test": "^3 || dev-FRAMEWORK_6_0",
5051
"ext-ctype": "*",
5152
"ext-ftp": "*",
5253
"ext-pam": "*",
@@ -67,4 +68,4 @@
6768
"horde/horde-installer-plugin": true
6869
}
6970
}
70-
}
71+
}

0 commit comments

Comments
 (0)