From 39774526ec01494809914af17f15e8e95ac06750 Mon Sep 17 00:00:00 2001 From: Jonas Bengtsson Date: Fri, 3 Jan 2020 11:37:01 +0100 Subject: [PATCH] Initial version of job --- .github/android-lint-file-matcher.json | 19 +++++++++++++++++++ .github/android-lint-line-matcher.json | 19 +++++++++++++++++++ .github/gradle-matcher.json | 23 +++++++++++++++++++++++ .github/kotlin-error-matcher.json | 19 +++++++++++++++++++ .github/kotlin-warning-matcher.json | 19 +++++++++++++++++++ README.md | 11 +++++++++++ action.yml | 5 +++++ index.js | 5 +++++ package-lock.json | 5 +++++ package.json | 12 ++++++++++++ 10 files changed, 137 insertions(+) create mode 100644 .github/android-lint-file-matcher.json create mode 100644 .github/android-lint-line-matcher.json create mode 100644 .github/gradle-matcher.json create mode 100644 .github/kotlin-error-matcher.json create mode 100644 .github/kotlin-warning-matcher.json create mode 100644 README.md create mode 100644 action.yml create mode 100644 index.js create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.github/android-lint-file-matcher.json b/.github/android-lint-file-matcher.json new file mode 100644 index 0000000..157e577 --- /dev/null +++ b/.github/android-lint-file-matcher.json @@ -0,0 +1,19 @@ +{ + // Example: + // /path/to/file/file.class: Warning: checkClientTrusted is empty, which could cause insecure network traffic due to trusting arbitrary TLS/SSL certificates presented by peers [TrustAllX509TrustManager] + "problemMatcher": [ + { + "owner": "android-lint-file", + "pattern": [ + { + "regexp": "^(.+):\\s+(Warning|Error):\\s+(.+)\\s+\\[(.+)\\]$", + "file": 1, + "severity": 2, + "message": 3, + "code": 4, + "kind": "file" + } + ] + } + ] +} diff --git a/.github/android-lint-line-matcher.json b/.github/android-lint-line-matcher.json new file mode 100644 index 0000000..d517176 --- /dev/null +++ b/.github/android-lint-line-matcher.json @@ -0,0 +1,19 @@ +{ + // Example: + // /path/to/file/build.gradle:55: Warning: A newer version of androidx.core:core-ktx than 1.2.0-beta01 is available: 1.2.0-rc01 [GradleDependency] + "problemMatcher": [ + { + "owner": "android-lint-line", + "pattern": [ + { + "regexp": "^(.+):(\\d+):\\s+(Warning|Error):\\s+(.+)\\s+\\[(.+)\\]$", + "file": 1, + "line": 2, + "severity": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/.github/gradle-matcher.json b/.github/gradle-matcher.json new file mode 100644 index 0000000..b000336 --- /dev/null +++ b/.github/gradle-matcher.json @@ -0,0 +1,23 @@ +{ + // Example: + // warning unused-exclude-by-conf the exclude dependency is not in your dependency graph, so has no effect + // app/build.gradle:45 + "problemMatcher": [ + { + "owner": "gradle", + "pattern": [ + { + "regexp": "^(error|quiet|warning|lifecycle|info|debug)\\s+(\\S+)\\s+(.+)$", + "severity": 1, + "code": 2, + "message": 3 + }, + { + "regexp": "^([^\\s]+):([\\d]+)$", + "file": 1, + "line": 2 + } + ] + } + ] +} diff --git a/.github/kotlin-error-matcher.json b/.github/kotlin-error-matcher.json new file mode 100644 index 0000000..b3df3bb --- /dev/null +++ b/.github/kotlin-error-matcher.json @@ -0,0 +1,19 @@ +{ + // Example: + // e: /path/to/file/KotlinFile.kt: (14, 5): Val cannot be reassigned + "problemMatcher": [ + { + "owner": "kotlin-error", + "pattern": [ + { + "regexp": "^e:\\s+(\\S+):\\s+\\((\\d+),\\s+(\\d+)\\):\\s+(.+)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ], + "severity": "error" + } + ] +} diff --git a/.github/kotlin-warning-matcher.json b/.github/kotlin-warning-matcher.json new file mode 100644 index 0000000..b9dfca7 --- /dev/null +++ b/.github/kotlin-warning-matcher.json @@ -0,0 +1,19 @@ +{ + // Example: + // w: /path/to/file/KotlinFile.kt: (14, 5): Parameter 'foo' is never used + "problemMatcher": [ + { + "owner": "kotlin-warning", + "pattern": [ + { + "regexp": "^w:\\s+(\\S+):\\s+\\((\\d+),\\s+(\\d+)\\):\\s+(.+)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ], + "severity": "warning" + } + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..4d8df67 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Android Problem Matchers + +Adds common problem matchers for Android builds to GitHub Action workflows. + +## Inputs + +No inputs are needed. + +## Outputs + +No outputs are generated apart from configured problem matchers. \ No newline at end of file diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..e231b41 --- /dev/null +++ b/action.yml @@ -0,0 +1,5 @@ +name: 'Android Problem Matchers' +description: 'Adds common problem matchers for Android builds' +runs: + using: 'node12' + main: 'index.js' diff --git a/index.js b/index.js new file mode 100644 index 0000000..25ea2a9 --- /dev/null +++ b/index.js @@ -0,0 +1,5 @@ +console.log("::add-matcher::.github/android-lint-file-matcher.json"); +console.log("::add-matcher::.github/android-lint-line-matcher.json"); +console.log("::add-matcher::.github/gradle-matcher.json"); +console.log("::add-matcher::.github/kotlin-error-matcher.json"); +console.log("::add-matcher::.github/kotlin-warning-matcher.json"); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..e6aceb4 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5 @@ +{ + "name": "android-problem-matchers-action", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..854ec41 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "android-problem-matchers-action", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +}