Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update some CI tests #791

Merged
merged 4 commits into from
Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ jobs:
exit 1;
}

- name: Check for open todos in lib folder
uses: ./.github/actions/check-todo
with:
path: lib

- name: Check for open todos in unit test folder
uses: ./.github/actions/check-todo
with:
path: tests/Unit

- name: Check for open todos in integration test folder
uses: ./.github/actions/check-todo
with:
path: tests/Integration



unit-tests:
name: Run the unittests
Expand Down Expand Up @@ -268,6 +284,7 @@ jobs:
uses: EnricoMi/publish-unit-test-result-action@v1.19
with:
files: "Junit test log files*/*.xml"
test_changes_limit: 100
#if: always()


Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
### Added
- Added unit tests for controllers
[#790](https://github.com/nextcloud/cookbook/pull/790) @christianlupus
- Added CI test to check for open todo tags in the source code
[#791](https://github.com/nextcloud/cookbook/pull/791) @christianlupus

### Fixed
- Mark app as compatible with Nextcloud 22
Expand Down