Skip to content

Commit

Permalink
feat: initial commit - repository bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosdevpereira committed Sep 22, 2022
0 parents commit e5ec273
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Test & Publish to Cloudflare
36 changes: 36 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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."
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* @TODO: Convert existing workflow from personal repository
* into this marketplace publishable action
*/
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit e5ec273

Please sign in to comment.