From e5ec273623772d25901d4a47e3d067b9cde01a62 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Date: Thu, 22 Sep 2022 14:07:14 +0100 Subject: [PATCH] feat: initial commit - repository bootstrap --- LICENSE | 21 +++++++++++++++++++++ README.md | 1 + action.yml | 36 ++++++++++++++++++++++++++++++++++++ index.js | 4 ++++ package.json | 27 +++++++++++++++++++++++++++ 5 files changed, 89 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 action.yml create mode 100644 index.js create mode 100644 package.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6c21777 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 Carlos Pereira <@carlosdevpereira> (https://github.com/carlosdevpereira) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d89275 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Test & Publish to Cloudflare \ No newline at end of file diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..73986ca --- /dev/null +++ b/action.yml @@ -0,0 +1,36 @@ +name: Test & Publish to Cloudflare +author: carlosdevpereira +description: This action runs the test command of a repository, generates the test coverage report, uploads the report to cloudflare pages and comments the results on available pull requests. + +runs: + using: "node16" + main: "index.js" + +inputs: + testCommand: + description: "The command used to run the unit tests of the repository (needs to be the explicit command and not an alias like `npm run test`)." + required: false + default: "./node_modules/jest/bin/jest.js --no-cache --detectOpenHandles --coverage" + cloudflareProjectName: + description: "The name of the project on Cloudflare that will receive the coverage report." + required: true + cloudflareApiToken: + description: "The API Token that will be used to upload the coverage report to Cloudflare." + required: true + cloudflareAccountId: + description: "The Account ID that will be used to upload the coverage report to Cloudflare." + required: true + githubToken: + description: "The github token that will be used to comment the results on available pull requests." + required: true + baseCloudflareDeploymentUrl: + description: "The base URL configured on the target Cloudflare project from which the deployments will be served - It can also be a custom domain configured on the target project. (defaults to https://${cloudflareProjectName}.pages.dev)" + required: false + +outputs: + coverage: + description: "The final coverage percentage - average between the coverage values for Statements/Branches/Functions and Lines." + reportUrl: + description: "The final URL to the coverage report served by Cloudflare." + affectedPullRequestUrls: + description: "Pull request URL's that this action wrote comments on." diff --git a/index.js b/index.js new file mode 100644 index 0000000..d0ad827 --- /dev/null +++ b/index.js @@ -0,0 +1,4 @@ +/** + * @TODO: Convert existing workflow from personal repository + * into this marketplace publishable action + */ diff --git a/package.json b/package.json new file mode 100644 index 0000000..4d611e5 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "test-publish-to-cloudflare", + "version": "1.0.0", + "description": "Github action that runs the test command of a repository, generates the test coverage report, uploads the report to cloudflare pages and comments the results on available pull requests.", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/carlosdevpereira/test-publish-to-cloudflare.git" + }, + "keywords": [ + "github", + "action", + "github action", + "node", + "cloudflare", + "pages", + "test", + "test coverage", + "jest" + ], + "author": "carlosdevpereira", + "license": "MIT", + "bugs": { + "url": "https://github.com/carlosdevpereira/test-publish-to-cloudflare/issues" + }, + "homepage": "https://github.com/carlosdevpereira/test-publish-to-cloudflare#readme" +} \ No newline at end of file