diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 35170eb..0000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,132 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -- The use of sexualized language or imagery, and sexual attention or advances of - any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email address, - without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[agelrenorenardo@gmail.com](mailto:agelrenorenardo@gmail.com). -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][mozilla coc]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][faq]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[mozilla coc]: https://github.com/mozilla/diversity -[faq]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index cb5dd4b..0000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,216 +0,0 @@ -# CONTRIBUTING GUIDELINES - -codewars-solver is a community-driven project. Contribution is welcome, encouraged, and appreciated. -It is also essential for the development of the project. - -First, please take a moment to review our [code of conduct](CODE_OF_CONDUCT.md). - -These guidelines are an attempt at better addressing the huge amount of pending -issues and pull requests. Please read them closely. - -Foremost, be so kind as to [search](#use-the-search-luke). This ensures any contribution -you would make is not already covered. - - - -- [Reporting Issues](#reporting-issues) - - [You have a problem](#you-have-a-problem) - - [You have a suggestion](#you-have-a-suggestion) -- [Submitting Pull Requests](#submitting-pull-requests) - - [Getting started](#getting-started) - - [You have a solution](#you-have-a-solution) - - [You have an addition](#you-have-an-addition) -- [Use the Search, Luke](#use-the-search-luke) -- [Commit Guidelines](#commit-guidelines) - - [Format](#format) - - [Style](#style) -- [Volunteer](#volunteer) - - - -## Reporting Issues - -### You have a problem - -Please be so kind as to [search](#use-the-search-luke) for any open issue already covering -your problem. - -If you find one, comment on it, so we know more people are experiencing it. - -Then, you can go ahead and create an issue with as much detail as you can provide. -It should include the data gathered as indicated above, along with the following: - -1. How to reproduce the problem -2. What the correct behavior should be -3. What the actual behavior is - -Please copy to anyone relevant (e.g. plugin maintainers) by mentioning their GitHub handle -(starting with `@`) in your message. - -We will do our very best to help you. - -### You have a suggestion - -Please be so kind as to [search](#use-the-search-luke) for any open issue already covering -your suggestion. - -If you find one, comment on it, so we know more people are supporting it. - -If not, you can go ahead and create an issue. Please copy to anyone relevant (e.g. plugin -maintainers) by mentioning their GitHub handle (starting with `@`) in your message. - -## Submitting Pull Requests - -### Getting started - -You should be familiar with the basics of -[contributing on GitHub](https://help.github.com/articles/using-pull-requests) and have a fork - -You MUST always create PRs with _a dedicated branch_ based on the latest upstream tree. - -If you create your own PR, please make sure you do it right. Also be so kind as to reference -any issue that would be solved in the PR description body, -[for instance](https://help.github.com/articles/closing-issues-via-commit-messages/) -_"Fixes #XXXX"_ for issue number XXXX. - -### You have a solution - -Please be so kind as to [search](#use-the-search-luke) for any open issue already covering -your [problem](#you-have-a-problem), and any pending/merged/rejected PR covering your solution. - -If the solution is already reported, try it out and +1 the pull request if the -solution works ok. On the other hand, if you think your solution is better, post -it with reference to the other one so we can have both solutions to compare. - -If not, then go ahead and submit a PR. Please copy to anyone relevant (e.g. plugin -maintainers) by mentioning their GitHub handle (starting with `@`) in your message. - -### You have an addition - -Please be so kind as to [search](#use-the-search-luke) for any pending, merged or rejected Pull Requests -covering or related to what you want to add. - -If you find one, try it out and work with the author on a common solution. - -If not, then go ahead and submit a PR. Please copy to anyone relevant (e.g. plugin -maintainers) by mentioning their GitHub handle (starting with `@`) in your message. - -For any extensive change, such as a new plugin, you will have to find testers to +1 your PR. - ---- - -## Use the Search, Luke - -_May the Force (of past experiences) be with you_ - -GitHub offers [many search features](https://help.github.com/articles/searching-github/) -to help you check whether a similar contribution to yours already exists. Please search -before making any contribution, it avoids duplicates and eases maintenance. Trust me, -that works 90% of the time. - -If all fails, your thing has probably not been reported yet, so you can go ahead -and [create an issue](#reporting-issues) or [submit a PR](#submitting-pull-requests). - ---- - -## Commit Guidelines - -codewars-solver uses the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) -specification. The automatic changelog tool uses these to automatically generate -a changelog based on the commit messages. Here's a guide to writing a commit message -to allow this: - -### Format - -``` -type(scope)!: subject -``` - -- `type`: the type of the commit is one of the following: - - - `feat`: new features. - - `fix`: bug fixes. - - `docs`: documentation changes. - - `refactor`: refactor of a particular code section without introducing - new features or bug fixes. - - `style`: code style improvements. - - `perf`: performance improvements. - - `test`: changes to the test suite. - - `ci`: changes to the CI system. - - `build`: changes to the build system (we don't yet have one so this shouldn't apply). - - `chore`: for other changes that don't match previous types. This doesn't appear - in the changelog. - -- `scope`: section of the codebase that the commit makes changes to. If it makes changes to - many sections, or if no section in particular is modified, leave blank without the parentheses. - Examples: - - - Commit that changes the `git` plugin: - - ``` - feat(git): add alias for `git commit` - ``` - - - Commit that changes many plugins: - - ``` - style: fix inline declaration of arrays - ``` - - For changes to plugins or themes, the scope should be the plugin or theme name: - - - ✅ `fix(agnoster): commit subject` - - ❌ `fix(theme/agnoster): commit subject` - -- `!`: this goes after the `scope` (or the `type` if scope is empty), to indicate that the commit - introduces breaking changes. - - Optionally, you can specify a message that the changelog tool will display to the user to indicate - what's changed and what they can do to deal with it. You can use multiple lines to type this message; - the changelog parser will keep reading until the end of the commit message or until it finds an empty - line. - - Example (made up): - - ``` - style(agnoster)!: change dirty git repo glyph - - BREAKING CHANGE: the glyph to indicate when a git repository is dirty has - changed from a Powerline character to a standard UTF-8 emoji. You can - change it back by setting `ZSH_THEME_DIRTY_GLYPH`. - - Fixes #420 - - Co-authored-by: Username - ``` - -- `subject`: a brief description of the changes. This will be displayed in the changelog. If you need - to specify other details, you can use the commit body, but it won't be visible. - - Formatting tricks: the commit subject may contain: - - - Links to related issues or PRs by writing `#issue`. This will be highlighted by the changelog tool: - - ``` - feat(archlinux): add support for aura AUR helper (#9467) - ``` - - - Formatted inline code by using backticks: the text between backticks will also be highlighted by - the changelog tool: - ``` - feat(shell-proxy): enable unexported `DEFAULT_PROXY` setting (#9774) - ``` - -### Style - -Try to keep the first commit line short. It's harder to do using this commit style but try to be -concise, and if you need more space, you can use the commit body. Try to make sure that the commit -subject is clear and precise enough that users will know what changed by just looking at the changelog. - ---- - -## Volunteer - -Very nice!! :) - -Ask the maintainer at [**agelrenorenardo@gmail.com**](mailto:agelrenorenardo@gmail.com) if you are interested diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index b7e6d96..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: 🐛 Report a bug -description: Create a report to help us improve 🤕 -labels: ["bug"] -assignees: - - YisusChrist -body: - - type: markdown - attributes: - value: | - ## Self Check - - Look for similar errors in existing [GitHub Issues](https://github.com/YisusChrist/codewars-solver/issues?q=is%3Aissue) (open or closed). - - Take a look at the [documentation](https://github.com/YisusChrist/codewars-solver/wiki) for help. - - type: textarea - validations: - required: true - attributes: - label: Describe the bug - description: A clear description of what the bug is. - - type: textarea - validations: - required: true - attributes: - label: Steps to reproduce - description: | - Steps to reproduce the problem. - placeholder: | - For example: - 1. Execute with options '...' - 2. Check output '...' - 3. See error - - type: textarea - validations: - required: true - attributes: - label: Expected behavior - description: A brief description of what should happen. - - type: textarea - attributes: - label: Screenshots and recordings - description: | - If applicable, add screenshots to help explain your problem. You can also record an asciinema session: https://asciinema.org/ - - type: input - validations: - required: true - attributes: - label: OS / Linux distribution - placeholder: Windows 10, Ubuntu 20.04, Arch Linux, macOS 10.15... - - type: input - validations: - required: true - attributes: - label: codewars-solver version - description: Run `codewars-solver -V` to check. - placeholder: "1.0" - - type: textarea - attributes: - label: Additional context - description: Add any other context about the problem here. This can be path, platform, shell... diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index ae42e3b..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Contributing to codewars-solver - url: https://github.com/YisusChrist/codewars-solver/blob/main/CONTRIBUTING.md - about: Guidelines for how to report an issue. - - name: Support - url: https://github.com/YisusChrist/codewars-solver/discussions - about: Ask the community for support - - name: Documentation - url: https://github.com/YisusChrist/codewars-solver/wiki - about: Many questions might be already answered here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index d8942a1..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: 🚀 Feature request -description: Suggest a feature/idea for this project 💡 -labels: ["feature"] -assignees: - - YisusChrist -body: - - type: markdown - attributes: - value: | - ## Self Check - - Look for similar features in existing [GitHub Issues](https://github.com/YisusChrist/codewars-solver/issues?q=is%3Aissue) (open or closed). - - type: textarea - attributes: - label: If the feature solves a problem you have, specify it here. - description: A description of what the problem is. - placeholder: Ex. I'm always frustrated when... - - type: textarea - attributes: - label: Describe the proposed feature. - description: A description of what you want to happen. Be as specific as possible. - validations: - required: true - - type: textarea - attributes: - label: Describe alternatives you've considered - description: A description of any alternative solutions or features you've considered. This can also include other plugins or themes. - - type: textarea - attributes: - label: Additional context - description: Add any other context, screenshots or Discord conversations about the feature request here. Also if you have any PRs related to this issue that are already open that you would like us to look at. - - type: textarea - attributes: - label: Related Issues - description: Is there any open or closed issues that is related to this feature request? If so please link them below! diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml deleted file mode 100644 index 6fe833c..0000000 --- a/.github/ISSUE_TEMPLATE/question.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: ❓ Ask a question -description: Submit a question to get help or clarification 🙋‍♂️ -labels: ["question"] -assignees: - - YisusChrist -body: - - type: markdown - attributes: - value: | - ## Self Check - - Check the [documentation](https://github.com/YisusChrist/codewars-solver/wiki) and [GitHub Issues](https://github.com/YisusChrist/codewars-solver/issues?q=is%3Aissue) to see if your question has already been answered. - - type: textarea - validations: - required: true - attributes: - label: Question - description: Clearly state your question. - placeholder: "What is the purpose of the `codewars-solver` tool?" - - type: textarea - validations: - required: true - attributes: - label: Context - description: | - Provide any necessary context for your question. For example, explain the scenario or code that led to your question. - placeholder: | - I was trying to use the tool to solve a problem with the following code: - ```python - # code snippet here - ``` - - type: textarea - validations: - required: true - attributes: - label: Expected outcome or clarification needed - description: | - What do you expect to achieve, or what specific clarification are you seeking? - placeholder: | - I expected the tool to return a different output. - Can you clarify how the solver handles edge cases? - - type: input - validations: - required: true - attributes: - label: OS / Linux distribution - placeholder: Windows 10, Ubuntu 20.04, Arch Linux, macOS 10.15... - - type: input - validations: - required: true - attributes: - label: codewars-solver version - description: Run `codewars-solver -V` to check. - placeholder: "1.0" - - type: textarea - attributes: - label: Additional context or resources - description: Add any other context or references (e.g., links, code snippets) that may help in answering your question. diff --git a/.github/SECURITY.md b/.github/SECURITY.md deleted file mode 100644 index 461b4e1..0000000 --- a/.github/SECURITY.md +++ /dev/null @@ -1,24 +0,0 @@ -# Security Policy - -## Supported Versions - -At the moment codewars-solver only considers the very latest commit to be supported. -We combine that with our fast response to incidents and the automated updates -to minimize the time between vulnerability publication and patch release. - -| Version | Supported | -| :------------ | :----------------- | -| master | :white_check_mark: | -| other commits | :x: | - -In the near future we will introduce versioning, so expect this section to change. - -## Reporting a Vulnerability - -**Do not submit an issue or pull request**: this might reveal the vulnerability. - -Instead, you should email the maintainers directly at: [**agelrenorenardo@gmail.com**](mailto:agelrenorenardo@gmail.com). - -We will deal with the vulnerability privately and submit a patch as soon as possible. - -You can also submit your vulnerability report to [huntr.dev](https://huntr.dev/bounties/disclose/?target=https%3A%2F%2Fgithub.com%2Fyisuschrist%2Fcodewars-solver) and see if you can get a bounty reward. diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b6640ab..03bc6ed 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,22 +5,22 @@ version: 2 updates: - - package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - - package-ecosystem: pip - directory: "/.github/workflows" - schedule: - interval: daily - - package-ecosystem: pip - directory: "/docs" - schedule: - interval: daily - - package-ecosystem: pip - directory: "/" - schedule: - interval: daily - versioning-strategy: lockfile-only - allow: - - dependency-type: "all" + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + - package-ecosystem: pip + directory: "/.github/workflows" + schedule: + interval: daily + - package-ecosystem: pip + directory: "/docs" + schedule: + interval: daily + - package-ecosystem: pip + directory: "/" + schedule: + interval: daily + versioning-strategy: lockfile-only + allow: + - dependency-type: "all" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index cad8e7e..7a04410 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,29 +1,29 @@ categories: - - title: ":boom: Breaking Changes" - label: "breaking" - - title: ":rocket: Features" - label: "enhancement" - - title: ":fire: Removals and Deprecations" - label: "removal" - - title: ":beetle: Fixes" - label: "bug" - - title: ":racehorse: Performance" - label: "performance" - - title: ":rotating_light: Testing" - label: "testing" - - title: ":construction_worker: Continuous Integration" - label: "ci" - - title: ":books: Documentation" - label: "documentation" - - title: ":hammer: Refactoring" - label: "refactoring" - - title: ":lipstick: Style" - label: "style" - - title: ":package: Dependencies" - labels: - - "dependencies" - - "build" + - title: ":boom: Breaking Changes" + label: "breaking" + - title: ":rocket: Features" + label: "enhancement" + - title: ":fire: Removals and Deprecations" + label: "removal" + - title: ":beetle: Fixes" + label: "bug" + - title: ":racehorse: Performance" + label: "performance" + - title: ":rotating_light: Testing" + label: "testing" + - title: ":construction_worker: Continuous Integration" + label: "ci" + - title: ":books: Documentation" + label: "documentation" + - title: ":hammer: Refactoring" + label: "refactoring" + - title: ":lipstick: Style" + label: "style" + - title: ":package: Dependencies" + labels: + - "dependencies" + - "build" template: | - ## Changes + ## Changes - $CHANGES + $CHANGES diff --git a/.github/workflows/automerge-dependabot-prs.yml b/.github/workflows/automerge-dependabot-prs.yml index 5b24730..3a3aa3f 100644 --- a/.github/workflows/automerge-dependabot-prs.yml +++ b/.github/workflows/automerge-dependabot-prs.yml @@ -8,16 +8,5 @@ permissions: jobs: dependabot: - runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} - steps: - - name: Approve a PR - run: gh pr review --approve "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - name: Enable auto-merge for Dependabot PRs - run: gh pr merge --auto --rebase "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + uses: YisusChrist/github-actions-workflows/.github/workflows/automerge-dependabot-prs.yml@main + secrets: inherit diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 825aa6f..618772d 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,19 +1,12 @@ name: Labeler on: - push: - branches: - - main - - master + push: + branches: + - main + - master jobs: - labeler: - runs-on: ubuntu-latest - steps: - - name: Check out the repository - uses: actions/checkout@v4 - - - name: Run Labeler - uses: crazy-max/ghaction-github-labeler@v5.0.0 - with: - skip-delete: true + labeler: + uses: YisusChrist/github-actions-workflows/.github/workflows/labeler.yml@main + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ce3858..53c6145 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,79 +1,14 @@ name: Release on: - push: - branches: - - main - - master + push: + branches: + - main + - master jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Check out the repository - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Upgrade pip - run: | - pip install --constraint=.github/workflows/constraints.txt pip - pip --version - - - name: Install Poetry - run: | - pip install --constraint=.github/workflows/constraints.txt poetry - poetry --version - - - name: Check if there is a parent commit - id: check-parent-commit - run: | - echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)" - - - name: Detect and tag new version - id: check-version - if: steps.check-parent-commit.outputs.sha - uses: salsify/action-detect-and-tag-new-version@v2.0.3 - with: - version-command: | - bash -o pipefail -c "poetry version | awk '{ print \$2 }'" - - - name: Bump version for developmental release - if: "! steps.check-version.outputs.tag" - run: | - poetry version patch && - version=$(poetry version | awk '{ print $2 }') && - poetry version $version.dev.$(date +%s) - - - name: Build package - run: | - poetry build --ansi - - - name: Publish package on PyPI - if: steps.check-version.outputs.tag - uses: pypa/gh-action-pypi-publish@v1.10.3 - with: - user: __token__ - password: ${{ secrets.PYPI_TOKEN }} - - - name: Publish package on TestPyPI - if: "! steps.check-version.outputs.tag" - uses: pypa/gh-action-pypi-publish@v1.10.3 - with: - user: __token__ - password: ${{ secrets.TEST_PYPI_TOKEN }} - repository_url: https://test.pypi.org/legacy/ - - - name: Publish the release notes - uses: release-drafter/release-drafter@v6.0.0 - with: - publish: ${{ steps.check-version.outputs.tag != '' }} - tag: ${{ steps.check-version.outputs.tag }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + release: + uses: YisusChrist/github-actions-workflows/.github/workflows/release.yml@main + with: + python-version: "3.12" + secrets: inherit diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8695a51..3364235 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,170 +1,12 @@ name: Tests on: - - push - - pull_request + - push + - pull_request jobs: - tests: - name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - { - python: "3.10", - os: "ubuntu-latest", - session: "pre-commit", - } - - { python: "3.10", os: "ubuntu-latest", session: "safety" } - - { python: "3.10", os: "ubuntu-latest", session: "mypy" } - - { python: "3.9", os: "ubuntu-latest", session: "mypy" } - - { python: "3.8", os: "ubuntu-latest", session: "mypy" } - - { python: "3.7", os: "ubuntu-latest", session: "mypy" } - - { python: "3.10", os: "ubuntu-latest", session: "tests" } - - { python: "3.9", os: "ubuntu-latest", session: "tests" } - - { python: "3.8", os: "ubuntu-latest", session: "tests" } - - { python: "3.7", os: "ubuntu-latest", session: "tests" } - - { python: "3.10", os: "windows-latest", session: "tests" } - - { python: "3.10", os: "macos-latest", session: "tests" } - - { - python: "3.10", - os: "ubuntu-latest", - session: "typeguard", - } - - { - python: "3.10", - os: "ubuntu-latest", - session: "xdoctest", - } - - { - python: "3.10", - os: "ubuntu-latest", - session: "docs-build", - } - - env: - NOXSESSION: ${{ matrix.session }} - FORCE_COLOR: "1" - PRE_COMMIT_COLOR: "always" - - steps: - - name: Check out the repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - - name: Upgrade pip - run: | - pip install --constraint=.github/workflows/constraints.txt pip - pip --version - - - name: Upgrade pip in virtual environments - shell: python - run: | - import os - import pip - - with open(os.environ["GITHUB_ENV"], mode="a") as io: - print(f"VIRTUALENV_PIP={pip.__version__}", file=io) - - - name: Install Poetry - run: | - pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry - poetry --version - - - name: Install Nox - run: | - pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox - pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry - nox --version - - - name: Compute pre-commit cache key - if: matrix.session == 'pre-commit' - id: pre-commit-cache - shell: python - run: | - import hashlib - import sys - - python = "py{}.{}".format(*sys.version_info[:2]) - payload = sys.version.encode() + sys.executable.encode() - digest = hashlib.sha256(payload).hexdigest() - result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8]) - - print("::set-output name=result::{}".format(result)) - - - name: Restore pre-commit cache - uses: actions/cache@v4 - if: matrix.session == 'pre-commit' - with: - path: ~/.cache/pre-commit - key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }} - restore-keys: | - ${{ steps.pre-commit-cache.outputs.result }}- - - - name: Run Nox - run: | - nox --python=${{ matrix.python }} - - - name: Upload coverage data - if: always() && matrix.session == 'tests' - uses: "actions/upload-artifact@v4" - with: - name: coverage-data - path: ".coverage.*" - - - name: Upload documentation - if: matrix.session == 'docs-build' - uses: actions/upload-artifact@v4 - with: - name: docs - path: docs/_build - - coverage: - runs-on: ubuntu-latest - needs: tests - steps: - - name: Check out the repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Upgrade pip - run: | - pip install --constraint=.github/workflows/constraints.txt pip - pip --version - - - name: Install Poetry - run: | - pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry - poetry --version - - - name: Install Nox - run: | - pipx install --pip-args=--constraint=.github/workflows/constraints.txt nox - pipx inject --pip-args=--constraint=.github/workflows/constraints.txt nox nox-poetry - nox --version - - - name: Download coverage data - uses: actions/download-artifact@v4 - with: - name: coverage-data - - - name: Combine coverage data and display human readable report - run: | - nox --session=coverage - - - name: Create coverage report - run: | - nox --session=coverage -- xml - - - name: Upload coverage report - uses: codecov/codecov-action@v4.6.0 + tests: + uses: YisusChrist/github-actions-workflows/.github/workflows/tests.yml@main + with: + python-version: "3.12" + secrets: inherit