diff --git a/.github/workflows/instrumented.yml b/.github/workflows/instrumented.yml index 16a9c12..4af5f87 100644 --- a/.github/workflows/instrumented.yml +++ b/.github/workflows/instrumented.yml @@ -1,3 +1,4 @@ +# This file is autogenerated, do not modify name: Android Instrumented Tests @@ -7,21 +8,18 @@ on: pull_request: branches: [ "main" ] -env: - JAVA_VERSION: 17 - JAVA_DISTRIBUTION: temurin - jobs: + API-24: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: set up JDK + - name: set up JDK 17 uses: actions/setup-java@v3 with: - java-version: ${{env.JAVA_VERSION}} - distribution: ${{env.JAVA_DISTRIBUTION}} + java-version: 17 + distribution: temurin cache: gradle - name: Install Gradle Wrapper run: gradle wrapper @@ -34,4 +32,4 @@ jobs: arch: x86_64 target: google_apis script: ./gradlew :fuse:connectedCheck - \ No newline at end of file + diff --git a/.gitignore b/.gitignore index 5756353..74ae6f0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ gradlew.bat .gradle local.properties .idea/deploymentTargetDropDown.xml - +node_modules diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..8cef9ad --- /dev/null +++ b/package-lock.json @@ -0,0 +1,189 @@ +{ + "name": "fuse-android", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "fuse-android", + "version": "1.0.0", + "license": "Apache-2.0", + "devDependencies": { + "ejs": "^3.1.9" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.totalpave.com:48731/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/async": { + "version": "3.2.5", + "resolved": "https://registry.totalpave.com:48731/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", + "dev": true + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.totalpave.com:48731/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.totalpave.com:48731/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.totalpave.com:48731/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.totalpave.com:48731/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.totalpave.com:48731/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.totalpave.com:48731/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/ejs": { + "version": "3.1.9", + "resolved": "https://registry.totalpave.com:48731/ejs/-/ejs-3.1.9.tgz", + "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", + "dev": true, + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.totalpave.com:48731/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.totalpave.com:48731/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.totalpave.com:48731/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.totalpave.com:48731/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jake": { + "version": "10.8.7", + "resolved": "https://registry.totalpave.com:48731/jake/-/jake-10.8.7.tgz", + "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", + "dev": true, + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.totalpave.com:48731/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.totalpave.com:48731/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..05cda9c --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "fuse-android", + "private": true, + "version": "1.0.0", + "scripts": { + "compile-workflows": "ejs -f ./templates/workflows/data.json -o ./.github/workflows/instrumented.yml ./templates/workflows/instrumented.ejs" + }, + "author": "Breautek", + "license": "Apache-2.0", + "devDependencies": { + "ejs": "^3.1.9" + } +} diff --git a/templates/workflows/AutoGeneratedWarning.ejs b/templates/workflows/AutoGeneratedWarning.ejs new file mode 100644 index 0000000..832daf7 --- /dev/null +++ b/templates/workflows/AutoGeneratedWarning.ejs @@ -0,0 +1 @@ +# This file is autogenerated, do not modify \ No newline at end of file diff --git a/templates/workflows/data.json b/templates/workflows/data.json new file mode 100644 index 0000000..6d06f03 --- /dev/null +++ b/templates/workflows/data.json @@ -0,0 +1,17 @@ +{ + "config": { + "actionCheckoutVersion": "v4", + "actionSetupJavaVersion": "v3", + "actionAndroidEmulatorRunnerVersion": "v2", + "javaVersion": 17, + "javaDistribution": "temurin" + }, + "jobs": [ + { + "id": "API-24", + "api": 24, + "arch": "x86_64", + "target": "google_apis" + } + ] +} diff --git a/templates/workflows/instrumented.ejs b/templates/workflows/instrumented.ejs new file mode 100644 index 0000000..cb503c0 --- /dev/null +++ b/templates/workflows/instrumented.ejs @@ -0,0 +1,35 @@ +<%- include('AutoGeneratedWarning'); %> + +name: Android Instrumented Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: +<% for (const job of jobs) { %> + <%= job.id %>: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@<%= config.actionCheckoutVersion %> + - name: set up JDK <%= config.javaVersion %> + uses: actions/setup-java@<%= config.actionSetupJavaVersion %> + with: + java-version: <%= config.javaVersion %> + distribution: <%= config.javaDistribution %> + cache: gradle + - name: Install Gradle Wrapper + run: gradle wrapper + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: run tests + uses: reactivecircus/android-emulator-runner@<%= config.actionAndroidEmulatorRunnerVersion %> + with: + api-level: <%= job.api %> + arch: <%= job.arch %> + target: <%= job.target %> + script: ./gradlew :fuse:connectedCheck +<% } %>