Skip to content

Commit 47171f7

Browse files
committed
Initial changes for setup-android
1 parent aa16e13 commit 47171f7

File tree

18 files changed

+12997
-88
lines changed

18 files changed

+12997
-88
lines changed

.eslintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.eslintrc.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"plugins": ["jest", "@typescript-eslint"],
3+
"extends": ["plugin:github/es6"],
4+
"parser": "@typescript-eslint/parser",
5+
"parserOptions": {
6+
"ecmaVersion": 9,
7+
"sourceType": "module",
8+
"project": "./tsconfig.json"
9+
},
10+
"rules": {
11+
"eslint-comments/no-use": "off",
12+
"import/no-namespace": "off",
13+
"no-unused-vars": "off",
14+
"@typescript-eslint/no-unused-vars": "error",
15+
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
16+
"@typescript-eslint/no-require-imports": "error",
17+
"@typescript-eslint/array-type": "error",
18+
"@typescript-eslint/await-thenable": "error",
19+
"@typescript-eslint/ban-ts-ignore": "error",
20+
"camelcase": "off",
21+
"@typescript-eslint/camelcase": "error",
22+
"@typescript-eslint/class-name-casing": "error",
23+
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
24+
"@typescript-eslint/func-call-spacing": ["error", "never"],
25+
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
26+
"@typescript-eslint/no-array-constructor": "error",
27+
"@typescript-eslint/no-empty-interface": "error",
28+
"@typescript-eslint/no-explicit-any": "error",
29+
"@typescript-eslint/no-extraneous-class": "error",
30+
"@typescript-eslint/no-for-in-array": "error",
31+
"@typescript-eslint/no-inferrable-types": "error",
32+
"@typescript-eslint/no-misused-new": "error",
33+
"@typescript-eslint/no-namespace": "error",
34+
"@typescript-eslint/no-non-null-assertion": "warn",
35+
"@typescript-eslint/no-object-literal-type-assertion": "error",
36+
"@typescript-eslint/no-unnecessary-qualifier": "error",
37+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
38+
"@typescript-eslint/no-useless-constructor": "error",
39+
"@typescript-eslint/no-var-requires": "error",
40+
"@typescript-eslint/prefer-for-of": "warn",
41+
"@typescript-eslint/prefer-function-type": "warn",
42+
"@typescript-eslint/prefer-includes": "error",
43+
"@typescript-eslint/prefer-interface": "error",
44+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
45+
"@typescript-eslint/promise-function-async": "error",
46+
"@typescript-eslint/require-array-sort-compare": "error",
47+
"@typescript-eslint/restrict-plus-operands": "error",
48+
"semi": "off",
49+
"@typescript-eslint/semi": ["error", "never"],
50+
"@typescript-eslint/type-annotation-spacing": "error",
51+
"@typescript-eslint/unbound-method": "error",
52+
"no-console": "off"
53+
},
54+
"env": {
55+
"node": true,
56+
"es6": true,
57+
"jest/globals": true
58+
}
59+
}

.github/workflows/build-test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: build-test
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- '**.md'
7+
push:
8+
branches:
9+
- master
10+
- releases/*
11+
paths-ignore:
12+
- '**.md'
13+
14+
jobs:
15+
build:
16+
runs-on: ${{ matrix.operating-system }}
17+
strategy:
18+
matrix:
19+
operating-system: [ubuntu-latest, windows-latest, macos-latest]
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Setup node 12
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: 12.x
26+
- run: npm ci
27+
- run: npm run build
28+
- run: npm run format-check
29+
- run: npm test

.github/workflows/main.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.gitignore

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Ignore node_modules, ncc is used to compile nodejs modules into a single file
2+
node_modules/
3+
__tests__/runner/*
4+
5+
# Ignore js files that are transpiled from ts files in src/
6+
lib/
7+
8+
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
9+
# Logs
10+
logs
11+
*.log
12+
npm-debug.log*
13+
yarn-debug.log*
14+
yarn-error.log*
15+
lerna-debug.log*
16+
17+
# Diagnostic reports (https://nodejs.org/api/report.html)
18+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
# Directory for instrumented libs generated by jscoverage/JSCover
27+
lib-cov
28+
29+
# Coverage directory used by tools like istanbul
30+
coverage
31+
*.lcov
32+
33+
# nyc test coverage
34+
.nyc_output
35+
36+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
37+
.grunt
38+
39+
# Bower dependency directory (https://bower.io/)
40+
bower_components
41+
42+
# node-waf configuration
43+
.lock-wscript
44+
45+
# Compiled binary addons (https://nodejs.org/api/addons.html)
46+
build/Release
47+
48+
# Dependency directories
49+
jspm_packages/
50+
51+
# TypeScript v1 declaration files
52+
typings/
53+
54+
# TypeScript cache
55+
*.tsbuildinfo
56+
57+
# Optional npm cache directory
58+
.npm
59+
60+
# Optional eslint cache
61+
.eslintcache
62+
63+
# Optional REPL history
64+
.node_repl_history
65+
66+
# Output of 'npm pack'
67+
*.tgz
68+
69+
# Yarn Integrity file
70+
.yarn-integrity
71+
72+
# dotenv environment variables file
73+
.env
74+
.env.test
75+
76+
# parcel-bundler cache (https://parceljs.org/)
77+
.cache
78+
79+
# next.js build output
80+
.next
81+
82+
# nuxt.js build output
83+
.nuxt
84+
85+
# vuepress build output
86+
.vuepress/dist
87+
88+
# Serverless directories
89+
.serverless/
90+
91+
# FuseBox cache
92+
.fusebox/
93+
94+
# DynamoDB Local files
95+
.dynamodb/
96+
.vscode/

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.prettierrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": false,
6+
"singleQuote": true,
7+
"trailingComma": "none",
8+
"bracketSpacing": false,
9+
"arrowParens": "avoid",
10+
"parser": "typescript"
11+
}

README.md

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,7 @@
1-
# Android Problem Matchers
1+
# setup-android
2+
For setting up the android sdk in a github-action
23

3-
Adds common problem matchers for Android builds to GitHub Action workflows. Currently adds support for the following tools:
4+
<!-- TODO: write readme -->
45

5-
* Kotlin compiler
6-
* Android Lint
7-
* Gradle
8-
9-
This action only configures the problem matchers in order to be compatible with diverse Android workflows.
10-
11-
## Inputs
12-
13-
No inputs are needed.
14-
15-
## Outputs
16-
17-
No outputs are generated apart from configured problem matchers.
18-
19-
## Example usage
20-
21-
In your workflow YAML file add this step:
22-
23-
```yaml
24-
- name: Setup Android problem matchers
25-
uses: jonasb/android-problem-matchers-action@v1
26-
```
27-
28-
Example full workflow definition:
29-
30-
```yaml
31-
name: Android CI
32-
on: [push]
33-
jobs:
34-
build:
35-
runs-on: ubuntu-latest
36-
steps:
37-
- uses: actions/checkout@v1
38-
- name: Setup JDK 1.8
39-
uses: actions/setup-java@v1
40-
with:
41-
java-version: 1.8
42-
- name: Setup Android problem matchers
43-
uses: jonasb/android-problem-matchers-action@v1
44-
- name: Build Android
45-
run: |
46-
./gradlew build -PisCI=true
47-
```
48-
49-
In order for Android Lint problems (especially warnings) to show up in the logs and be detected, make these changes to `app/build.gradle`:
50-
51-
```groovy
52-
android {
53-
lintOptions {
54-
textReport project.hasProperty('isCI')
55-
textOutput 'stdout'
56-
}
57-
}
58-
```
6+
# Thanks
7+
Based on the project [android-problem-matchers-action](https://github.com/jonasb/android-problem-matchers-action) from [@jonasb](https://github.com/jonasb)

__tests__/matchers.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
describe('setup-android', () => {
2+
it('has sanity', async () => {
3+
expect(true)
4+
})
5+
})
File renamed without changes.

0 commit comments

Comments
 (0)