Skip to content

Commit

Permalink
Initial action and workflow implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelstolt committed Oct 2, 2023
0 parents commit 7c686b0
Show file tree
Hide file tree
Showing 18 changed files with 12,830 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
* text=auto eol=lf

.editorconfig export-ignore
.gitattributes export-ignore
.github/ export-ignore
.gitignore export-ignore
.prettierignore export-ignore
.prettierrc.json export-ignore
CHANGELOG.md export-ignore
LICENSE.md export-ignore
README.md export-ignore
tsconfig.json export-ignore
package.json export-ignore
__tests__/ export-ignore
badges/ export-ignore
31 changes: 31 additions & 0 deletions .github/workflows/validation-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lean package validation on pull request event

on: [push,pull_request]

jobs:
build-and-push-docker-image:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1.0.0
with:
fetch-depth: 1
- name: Build Docker image
run: docker build --file Dockerfile --tag raphaelstolt/lean-package-validator-action:latest .
- name: Do Docker login
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- name: Push Docker image
run: docker push raphaelstolt/lean-package-validator-action

validate-package:
name: Validate package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1.0.0
with:
fetch-depth: 1
- name: Run the package validation
run: docker run -v $(pwd):/tmp/validation-stage raphaelstolt/lean-package-validator-action:latest
31 changes: 31 additions & 0 deletions .github/workflows/validation-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lean package validation on release event

on: [release]

jobs:
build-and-push-docker-image:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1.0.0
with:
fetch-depth: 1
- name: Build Docker image
run: docker build --file Dockerfile --tag raphaelstolt/lean-package-validator-action:${GITHUB_REF} .
- name: Do Docker login
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- name: Push Docker image
run: docker push raphaelstolt/lean-package-validator-action

validate-package:
name: Validate package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1.0.0
with:
fetch-depth: 1
- name: Run the package validation
run: docker run -v $(pwd):/tmp/validation-stage raphaelstolt/lean-package-validator-action:${GITHUB_REF}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
node_modules/
coverage/
16 changes: 16 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"bracketSameLine": true,
"arrowParens": "avoid",
"proseWrap": "always",
"htmlWhitespaceSensitivity": "css",
"endOfLine": "lf"
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log
All notable changes to this GitHub Action will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## v1.0.0 - 2019-09-04
- Initial release.
9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2019 - ∞ Raphael Stolt

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.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# LeanPackageValidator GitHub Action

The LeanPackageValidator GitHub Action is utilising the [LeanPackage Validator](https://github.com/raphaelstolt/lean-package-validator), which can validate a
project/micro-package for its `leanness`. A project/micro-package is considered `lean` when its common
repository artifacts won't be included in the release assets.

#### License
This GitHub Action is licensed under the MIT license. Please see [LICENSE.md](LICENSE.md) for more details.

#### Changelog
Please see [CHANGELOG.md](CHANGELOG.md) for more details.
13 changes: 13 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'lean-package-validator'

branding:
icon: 'package'
color: 'green'

description: 'An GitHub action that validates a micro-package for its leanness. A project/micro-package is considered `lean` when its common repository artifacts won't be included in the release assets.'

author: 'Raphael Stolt'

runs:
using: node20
main: dist/index.js
1 change: 1 addition & 0 deletions badges/leanness.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7c686b0

Please sign in to comment.