Skip to content

Commit

Permalink
Hatch, gh actions, docker and several repo goodies I use in all my pr…
Browse files Browse the repository at this point in the history
…ojects
  • Loading branch information
matagus committed Mar 23, 2024
1 parent 9447f3b commit 0187b3c
Show file tree
Hide file tree
Showing 25 changed files with 707 additions and 25 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[run]
include = jirahub/*
omit = *migrations*, *tests*
plugins =
django_coverage_plugin
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.*
!.coveragerc
!.env
!.pylintrc
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# http://editorconfig.org

root = true

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

[*.py]
indent_size = 4

[Makefile]
indent_style = tab
14 changes: 14 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Code of Conduct

Everyone interacting in this project is expected to follow the
[Django's Code of Conduct](https://www.djangoproject.com/conduct/). This includes all infrastructure
used in the development of this project, such as codebase, issue tracker, chat rooms, and mailing lists.

In general, this means that everyone is expected to be **open**, **considerate**, and **respectful**
of others no matter what their position is within the project.

## Reporting

All incidents should be reported by matagus+coc@gmail.com. This email is an alias with the following responders:

* Matias Agustin Mendez (https://github.com/matagus)
22 changes: 22 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
* Other unethical or unprofessional conduct.

Project maintainers 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. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.

This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Bug Report
description: File a bug
body:
- type: input
id: macos_version
attributes:
label: Operating System
description: Which operating system were you using?
placeholder: MacOS Sonoma 14.3
validations:
required: false
- type: input
id: package_version
attributes:
label: Package Version
description: Which version of this package were you using? If not the latest version, please check this issue has not since been resolved.
placeholder: 0.2.0
validations:
required: false
- type: input
id: python_version
attributes:
label: Python Version
description: Which version of Python were you using?
placeholder: 3.12.0
validations:
required: false
- type: textarea
id: description
attributes:
label: Description
description: Please describe the bug
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a Question
url: https://github.com/matagus/matorral/discussions/new?category=q-a&title=[Question]
about: Ask questions and discuss with other community members
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Feature Request
description: Request an enhancement or new feature.
body:
- type: textarea
id: description
attributes:
label: Description
description: Please describe your feature request with appropriate detail.
validations:
required: true
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This closes #.
1 change: 1 addition & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please report security issues directly over email to matagus+security@gmail.com
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
149 changes: 149 additions & 0 deletions .github/labels.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
[accessibility]
color = "687DEA"
name = "accessibility"
description = "Accessibility issues"

[admin]
color = "2E6BAB"
name = "admin"
description = "Admin related issue"

["blocked/needs-investigation"]
color = "BD134F"
name = "blocked/needs-investigation"
description = "This is blocked: it needs investigation"

["blocked/user-responsee"]
color = "3C0113"
name = "blocked/user-responsee"
description = "Blocked: this issue is waiting for user response"

[breaking]
color = "EF24EB"
name = "breaking"
description = "This is a breaking change"

[bug]
color = "d73a4a"
name = "bug"
description = "Something isn't working"

["code quality"]
color = "4D8FA9"
name = "code quality"
description = "Code Quality"

["could not reproduce"]
color = "E4B665"
name = "could not reproduce"
description = "Could not reproduce"

[dependencies]
color = "D7AFA0"
name = "dependencies"
description = "Dependencies"

[documentation]
color = "0075ca"
name = "documentation"
description = "Improvements or additions to documentation"

[duplicate]
color = "cfd3d7"
name = "duplicate"
description = "This issue or pull request already exists"

[enhancement]
color = "a2eeef"
name = "enhancement"
description = "New feature or request"

[epic]
color = "4471DE"
name = "epic"
description = "This is an Epic"

["feature request"]
color = "AF6601"
name = "feature request"
description = "Feature Requests"

[github-actions]
color = "595E8A"
name = "github-actions"
description = "Github Actions"

["good first issue"]
color = "2AF655"
name = "good first issue"
description = "Good for newcomers"

["help wanted"]
color = "008672"
name = "help wanted"
description = "Extra attention is needed"

[i18n]
color = "1D3BFB"
name = "i18n"
description = "Internacionalization and translations"

[implemented]
color = "071BB8"
name = "implemented"
description = "This has already been implemented"

[invalid]
color = "e4e669"
name = "invalid"
description = "This doesn't seem right"

[non-code-contribution]
color = "63B6DA"
name = "non-code-contribution"
description = "Contributions that doesn't involve programming"

[nonchangelog]
color = "9A9D37"
name = "nonchangelog"
description = "Ignore this issue when building the changelog"

["on hold"]
color = "A9221E"
name = "on hold"
description = "On Hold"

[question]
color = "d876e3"
name = "question"
description = "Further information is requested"

[security]
color = "B1661C"
name = "security"
description = "Security related issue"

[stale]
color = "FD622F"
name = "stale"
description = "Stale issues"

[tests]
color = "E2AC68"
name = "tests"
description = "Issue about a test"

[ux]
color = "AACC48"
name = "ux"
description = "User Experience related issues"

[wip]
color = "5B8E1C"
name = "wip"
description = "Work in progress"

[wontfix]
color = "ffffff"
name = "wontfix"
description = "This will not be worked on"
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
env:
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}

jobs:
test:
strategy:
max-parallel: 2
fail-fast: true
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
django-version: ["4.0", "4.1", "4.2", "5.0"]
os: [ubuntu-latest]
exclude:
- django-version: "4.0"
python-version: "3.11"
- django-version: "4.0"
python-version: "3.12"
- django-version: "4.1"
python-version: "3.12"
- django-version: "5.0"
python-version: "3.9"
runs-on: ${{ matrix.os }}
env:
ENVIRONMENT: "test"
CELERY_ALWAYS_EAGER: 1
DJANGO_EMAIL_BACKEND: "django.core.mail.backends.console.EmailBackend"
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade hatch
- name: Run tests for Python ${{ matrix.python-version }} and Django ${{ matrix.django-version }} on ${{ matrix.os }} with coverage report
run: |
hatch run test.py${{ matrix.python-version }}-${{ matrix.django-version }}:cov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
22 changes: 22 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Sync Github labels

on:
push:
branches:
- main
paths:
- ".github/**"

jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install labels
run: pip install labels
- name: Sync config with Github
run: labels -u ${{ github.repository_owner }} -t ${{ secrets.GITHUB_TOKEN }} sync -f .github/labels.toml
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Create Draft Release

on:
workflow_dispatch:
push:
tags:
- "v*"

jobs:

build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
with:
draft: true
allowUpdates: true
generateReleaseNotes: true
Loading

0 comments on commit 0187b3c

Please sign in to comment.