Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSSify Sending #20

Merged
merged 3 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- OS: [e.g. macOS, Linux, WSL]
- Python Version: [e.g. 3.8.2]
- Library Version: [e.g. 1.1.0]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
18 changes: 18 additions & 0 deletions .github/actions/setup-redis/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Install Redis-Server
description: Installs the redis-server CLI

runs:
using: composite
steps:
- name: Install Redis
shell: bash
# copied from https://redis.io/docs/getting-started/installation/install-redis-on-linux/
run: |
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] \
https://packages.redis.io/deb $(lsb_release -cs) main" \
| sudo tee /etc/apt/sources.list.d/redis.list

sudo apt-get update
sudo apt-get install redis
20 changes: 20 additions & 0 deletions .github/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
codecov:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "reach,diff,flags,files,footer"
behavior: default
require_changes: no
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip"
directory: "/" # Location of package manifests
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "daily"
48 changes: 48 additions & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
###########################################
# These are the rules used for #
# linting all the yaml files in the stack #
# NOTE: #
# You can disable line with: #
# # yamllint disable-line #
###########################################
extends: default

rules:
colons:
max-spaces-before: 0
max-spaces-after: 1

commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1

comments: disable

comments-indentation: disable

document-end: disable

document-start:
present: false

empty-lines:
max: 2
max-start: 0
max-end: 0

hyphens:
max-spaces-after: 1

indentation:
spaces: consistent
indent-sequences: true
check-multi-line-strings: false

line-length:
max: 160

new-line-at-end-of-file: enable

new-lines:
type: unix
22 changes: 22 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependabot auto-merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.3.3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
28 changes: 28 additions & 0 deletions .github/workflows/base-linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Base Linting

# Trigger the workflow on all pull requests and only pushes to the main branch
# yamllint disable-line rule:truthy
on:
pull_request:
branches:
- main

jobs:
base-linting:
name: base-linting
runs-on: ubuntu-20.04

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Lint Dockerfile, Shell scripts, YAML
uses: github/super-linter@v4
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Linters to enable
VALIDATE_BASH: true
VALIDATE_BASH_EXEC: true
VALIDATE_YAML: true
51 changes: 51 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Sending Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python_version: ["3.8", "3.9", "3.10"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup nox
uses: daisylb/setup-nox@v2.1.0
- name: Setup poetry
uses: Gr1N/setup-poetry@v7
- name: Install dependencies
run: |
poetry export -f requirements.txt --without-hashes --dev > /tmp/requirements.txt
pip install --constraint=/tmp/requirements.txt nox_poetry
- name: Start Redis
uses: ./.github/actions/setup-redis
run: redis-server
- name: Run tests
run: nox -s test-${{ matrix.python_version }}
- name: Generate coverage XML
run: nox -s generate_coverage_xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
lint:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup nox
uses: daisylb/setup-nox@v2.1.0
- name: Setup poetry
uses: Gr1N/setup-poetry@v7
- name: Install dependencies
run: |
poetry export -f requirements.txt --without-hashes --dev > /tmp/requirements.txt
pip install --constraint=/tmp/requirements.txt nox_poetry
- name: Run lint
run: nox -s lint
44 changes: 0 additions & 44 deletions .github/workflows/main.yaml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Publish Python Package
on:
push:
tags:
- '*'

jobs:
build-and-publish:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Publish to PyPI
uses: JRubics/poetry-publish@v1.12
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Standard Noteable open source patterns
- Contributing / Code of Conduct files
- Issue templates
- CI/CD files and noxfile syntax

### Changed
- Use `managed_service_fixtures` for Redis tests

Expand Down
Loading