JonasPammer / cookiecutter-github-action-typescript-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CookieCutter GitHub Action TypeScript Test

System Requirements

Usage

This action needs the GITHUB_TOKEN secret as it interacts with the GitHub API to FIXME describe why.

The action can be used as follows

.github/ci/cookiecutter-github-action-typescript-test.yml
---
name: CookieCutter GitHub Action TypeScript Test
permissions:
  # FIXME: add project-dependant relevant permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
"on":
  push:
    branches:
      - master
    paths:
      - ".github/workflows/cookiecutter-github-action-typescript-test.yml"
      # FIXME: add project-dependant relevant paths

jobs:
  labels:
    name: Invoke cookiecutter-github-action-typescript-test action
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: JonasPammer/cookiecutter-github-action-typescript-test@master # FIXME: change to release version
        env:
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Scenarios

TODO

๐Ÿ“ Development

pre-commit pre-commit.ci status code style: prettier Conventional Commits

๐Ÿ“Œ Development Machine Dependencies

  • NodeJS (LTS tested)

  • Python 3

๐Ÿ“Œ Development Dependencies

The Dependencies of this Project are defined in package.json. Install via:

$ npm install -D

The Dependencies of Additional Development Tools are defined in a python pip requirements file named requirements-dev.txt. Example Installation Instructions for Linux are shown below:

# "optional": create a python virtualenv and activate it for the current shell session
$ python3 -m venv venv
$ source venv/bin/activate

$ python3 -m pip install -r requirements-dev.txt

๐Ÿงช Testing

Automatic Tests are run on each Contribution using GitHub Workflows.

To run the tests, simply run npm run build followed by npm run test on the command line.

๐Ÿ“ฆ Packaging

As defined in action.yml, the primary entry point for this action is dist/index.js. This bundled file needs to be generated by issuing npm run build followed by npm run package.

Tip
Packaging is performed on each contribution by a GitHub workflow, which automatically commits the generated files back to the repository.

๐Ÿ”ข Versioning

Versions are defined using Tags.

Versions must start with v.

Note that major version tags (e.g. v1, v2) are basically just pointers to the latest version within said major version constraint (e.g. v1.2.3). This is accomplished through the use of a GitHub Workflow that issues nowactions/update-majorver on each push of a tag starting with v.

๐Ÿช CookieCutter

This Project shall be kept in sync with the CookieCutter it was originally templated from using cruft (if possible) or manual alteration (if needed) to the best extend possible.

Official Example Usage of cruft update
Official Example Usage of `cruft update`

๐Ÿ•— Changelog

When a new tag is pushed, an appropriate GitHub Release will be created by the Repository Maintainer to provide a proper human change log with a title and description.

โ„น๏ธ General Linting and Styling Conventions

General Linting and Styling Conventions are automatically held up to Standards by various pre-commit hooks, at least to some extend.

Automatic Execution of pre-commit is done on each Contribution using pre-commit.ci*. Pull Requests even automatically get fixed by the same tool, at least by hooks that automatically alter files.

Note
Not to confuse: Although some pre-commit hooks may be able to warn you about script-analyzed flaws in syntax or even code to some extend (for which reason pre-commitโ€™s hooks are part of the test suite), pre-commit itself does not run any real Test Suites. For Information on Testing, see ๐Ÿงช Testing.
Tip

Nevertheless, I recommend you to integrate pre-commit into your local development workflow yourself.

This can be done by cdโ€™ing into the directory of your cloned project and running pre-commit install. Doing so will make git run pre-commit checks on every commit you make, aborting the commit themselves if a hook alarmโ€™ed.

You can also, for example, execute pre-commitโ€™s hooks at any time by running pre-commit run --all-files.

๐Ÿ’ช Contributing PRs Welcome

Open in Visual Studio Code

The following sections are generic in nature and are used to help new contributors. The actual "Development Documentation" of this project is found under ๐Ÿ“ Development.

๐Ÿค Preamble

First off, thank you for considering contributing to this Project.

Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.

๐Ÿช CookieCutter

This Project owns many of its files to the CookieCutter it was originally templated from.

Please check if the edit you have in mind is actually applicable to the template and if so make an appropriate change there instead. Your change may also be applicable partly to the template as well as partly to something specific to this project, in which case you would be creating multiple PRs.

๐Ÿ’ฌ Conventional Commits

A casual contributor does not have to worry about following the spec by definition, as pull requests are being squash merged into one commit in the project. Only core contributors, i.e. those with rights to push to this projectโ€™s branches, must follow it (e.g. to allow for automatic version determination and changelog generation to work).

๐Ÿš€ Getting Started

Contributions are made to this repo via Issues and Pull Requests (PRs). A few general guidelines that cover both:

Issues

Issues should be used to report problems, request a new feature, or to discuss potential changes before a PR is created. When you create a new Issue, a template will be loaded that will guide you through collecting and providing the information we need to investigate.

If you find an Issue that addresses the problem youโ€™re having, please add your own reproduction information to the existing issue rather than creating a new one. Adding a reaction can also help be indicating to our maintainers that a particular problem is affecting more than just the reporter.

Pull Requests

PRs to this Project are always welcome and can be a quick way to get your fix or improvement slated for the next release. In general, PRs should:

  • Only fix/add the functionality in question OR address wide-spread whitespace/style issues, not both.

  • Add unit or integration tests for fixed or changed functionality (if a test suite already exists).

  • Address a single concern

  • Include documentation in the repo

  • Be accompanied by a complete Pull Request template (loaded automatically when a PR is created).

For changes that address core functionality or would require breaking changes (e.g. a major release), itโ€™s best to open an Issue to discuss your proposal first.

In general, we follow the "fork-and-pull" Git workflow

  1. Fork the repository to your own Github account

  2. Clone the project to your machine

  3. Create a branch locally with a succinct but descriptive name

  4. Commit changes to the branch

  5. Following any formatting and testing guidelines specific to this repo

  6. Push changes to your fork

  7. Open a PR in our repository and follow the PR template so that we can efficiently review the changes.

๐Ÿ—’ Changelog

Please refer to the Release Page of this Repository for a human changelog of the corresponding Tags (Versions) of this Project.

Note that this Project adheres to Semantic Versioning. Please report any accidental breaking changes of a minor version update.

โš–๏ธ License

MIT License

Copyright (c) 2022, Jonas Pammer

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.

About

License:MIT License


Languages

Language:TypeScript 42.1%Language:Dockerfile 39.0%Language:JavaScript 15.6%Language:Shell 3.3%