Skip to content

Commit

Permalink
Merge pull request #795 from nextcloud/release/0.9.3
Browse files Browse the repository at this point in the history
Create Release 0.9.3
  • Loading branch information
christianlupus authored Sep 26, 2021
2 parents fdcd177 + 91ee0ff commit 1cf5413
Show file tree
Hide file tree
Showing 53 changed files with 2,127 additions and 274 deletions.
23 changes: 23 additions & 0 deletions .github/actions/check-todo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check for todo comments in the codebase
author: Christian Wolf <github@christianwolf.email>
description: <
This is a github action to look out for any remaining todos in the code base.
Any todo will be marked with a warning.

inputs:
path:
description: The path to look for source files
required: false
default: '.'
extension:
description: The file extension to look for
required: true
default: php

runs:
using: 'composite'

steps:
- name: Add annotations
shell: bash
run: ./.github/actions/check-todo/check.sh "${{ inputs.path }}" "${{ inputs.extension }}"
13 changes: 13 additions & 0 deletions .github/actions/check-todo/check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Looking for all files
find "$1" -type f -name "*.$2" | while read line
do
file=$(echo "$line" | sed 's@^\./@@')

grep -noE '(TODO|ToDo|@todo|XXX|FIXME|FixMe).*' "$line" | while read match
do
IFS=: read lineno msg <<< "$match"
echo "::warning file=$file,line=$lineno::Found $msg"
done
done
2 changes: 1 addition & 1 deletion .github/actions/deploy/appinfo/info.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<screenshot>https://raw.githubusercontent.com/nextcloud/cookbook/stable/img/screenshot2.png</screenshot>
<dependencies>
<php min-version="7.3"/>
<nextcloud min-version="19" max-version="21"/>
<nextcloud min-version="19" max-version="22"/>
</dependencies>
<navigations>
<navigation>
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/deploy/create-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ echo "New version is $version."
git config user.name 'Github actions bot'
git config user.email 'bot@noreply.github.com'

"$deploy_path/fill-in-data.sh" "$version" "$major" "$minor" "$patch"
"$deploy_path/update-data.sh"

git add appinfo/info.xml package.json lib/Controller/MainController.php
git add package.json lib/Controller/MainController.php

git commit -s -m "Bump to version $version"
git tag "v$version"
Expand Down
13 changes: 13 additions & 0 deletions .github/actions/deploy/update-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /bin/sh

# set -x

deploy_path='.github/actions/deploy'

major=$(cat "$deploy_path/major")
minor=$(cat "$deploy_path/minor")
patch=$(cat "$deploy_path/patch")

version="$major.$minor.$patch"

"$deploy_path/fill-in-data.sh" "$version" "$major" "$minor" "$patch"
21 changes: 20 additions & 1 deletion .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@ runs:
--install-composer-deps
--run-tests
--extract-code-coverage
--shutdown-helpers
--shutdown-helpers || { failed=$?; } ;
if [ -n "$failed" ]; then
echo "test_result=$failed" >> $GITHUB_ENV;
else
echo "test_result=0" >> $GITHUB_ENV;
fi;
shell: bash
id: run

- name: Export the annotations of unit tests to github
shell: bash
run: >-
if [ -r .github/actions/run-tests/volumes/coverage/teamcity.log ]; then
python .github/actions/run-tests/extract-annotations.py .github/actions/run-tests/volumes/coverage/teamcity.log ;
fi
- name: Export the annotations of integration tests to github
shell: bash
run: >-
if [ -r .github/actions/run-tests/volumes/coverage/teamcity.integration.log ]; then
python .github/actions/run-tests/extract-annotations.py .github/actions/run-tests/volumes/coverage/teamcity.integration.log ;
fi
9 changes: 5 additions & 4 deletions .github/actions/run-tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ services:
DEBUG_START_MODE:
DEBUG_TRACE_FORMAT:
QUICK_MODE:
XDEBUG_LOG_LEVEL:
env_file:
- mysql.env
- postgres.env
volumes:
- ../../..:/cookbook:ro
- ./volumes/nextcloud:/nextcloud
- ./volumes/data:/nextcloud/data
- ./volumes/cookbook:/nextcloud/apps/cookbook
- ./volumes/cookbook:/nextcloud/custom_apps/cookbook
- ./volumes/dumps:/dumps
- ./volumes/coverage:/coverage
- ./volumes/www/:/www
Expand All @@ -75,7 +76,7 @@ services:

fpm:
<<: *dut
entrypoint: ["/usr/bin/tini", "--", "/entrypoints/default-entrypoint.sh", "docker-php-entrypoint"]
entrypoint: ["/usr/bin/tini", "--", "/entrypoints/minimal-default-entrypoint.sh", "docker-php-entrypoint"]
command: ['php-fpm']
user: root

Expand All @@ -85,7 +86,7 @@ services:
- ./config/apache/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro
- ./volumes/nextcloud:/nextcloud:ro
- ./volumes/data:/nextcloud/data:ro
- ./volumes/cookbook:/nextcloud/apps/cookbook:ro
- ./volumes/cookbook:/nextcloud/custom_apps/cookbook:ro

nginx:
image: nginx:alpine
Expand All @@ -94,7 +95,7 @@ services:
- ./config/nginx/conf.d:/etc/nginx/conf.d:ro
- ./volumes/nextcloud:/nextcloud:ro
- ./volumes/data:/nextcloud/data:ro
- ./volumes/cookbook:/nextcloud/apps/cookbook:ro
- ./volumes/cookbook:/nextcloud/custom_apps/cookbook:ro

www:
image: nginx:alpine
Expand Down
84 changes: 84 additions & 0 deletions .github/actions/run-tests/extract-annotations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/env python

import argparse
import os.path
import re

parser = argparse.ArgumentParser()

parser.add_argument('file', nargs=1, help='The log file to parse')
args = parser.parse_args()

logfile = args.file[0]
if not os.path.isfile(logfile):
print(f"The file {logfile} could not be found.")
exit(1)

detailsMatcher = re.compile("name='([^']*)' message='([^']*)'.*?details='\s*([^:]*):([0-9]+).*'")
fileNameMatcher = re.compile("/nextcloud/custom_apps/cookbook/(.*)")
def parseTestDetails(l):
match = detailsMatcher.search(l)
ret = {}
ret['name'] = match.group(1)
ret['message'] = match.group(2)
ret['line'] = match.group(4)

match2 = fileNameMatcher.match(match.group(3))
ret['file'] = match2.group(1)

return ret

def parseIgnoredLine(l):
details = parseTestDetails(l)
#print(l)
#print(details)

if details['message'] == '':
message = f"The test {details['name']} is skipped."
else:
message = details['message']

print(f"::warning file={details['file']},line={details['line']}::{message}")

def parseFailedLine(l):
details = parseTestDetails(l)
#print(l)
#print(details)

print(f"::error file={details['file']},line={details['line']}::{details['message']}")

matchers = [
{
'regex': '^##teamcity\\[testIgnored',
'fcn': parseIgnoredLine
},
{
'regex': '^##teamcity\\[testFailed',
'fcn': parseFailedLine
}
]

for m in matchers:
m['m'] = re.compile(m['regex'])


def parseLine(l):
for m in matchers:
if m['m'].match(l):
m['fcn'](l)
return

with open(logfile, 'r') as f:
while True:
l = f.readline()

if not l:
break

parseLine(l)

#print(l)

#print(matchers)

exit(0)
2 changes: 1 addition & 1 deletion .github/actions/run-tests/mysql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

FROM mariadb:10.1
FROM mariadb:10.5

LABEL maintainer="Christian Wolf <github@christianwolf.email>"

Expand Down
Loading

0 comments on commit 1cf5413

Please sign in to comment.