Skip to content

Commit

Permalink
fix: put back some gh stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Sep 5, 2024
1 parent 059921b commit 4101415
Show file tree
Hide file tree
Showing 9 changed files with 267 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug report
about: Report an error that you've encountered.
labels: 'category: bug'
---

### Environment information

- OS: macOS / linux / win
- Python Version: x.x.x

### What went wrong?

Please include information like:

- what command you ran
- the code that caused the failure (see [this link](https://help.github.com/articles/basic-writing-and-formatting-syntax/) for help with formatting code)
- full output of the error you received

### How can it be fixed?

Fill this in if you have ideas on how the bug could be fixed.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature request
about: Request a new feature, or an improvement to existing functionality.
labels: 'category: feature'
---

### Overview

Provide a simple overview of what you wish to see added. Please include:

- What you are trying to do
- Why Ape's current functionality is inadequate to address your goal

### Specification

Describe the syntax and semantics of how you would like to see this feature implemented. The more detailed the better!

Remember, your feature is much more likely to be included if it does not involve any breaking changes.

### Dependencies

Include links to any open issues that must be resolved before this feature can be implemented.
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### What I did

<!-- Create a summary of the changes -->

<!-- The `fixes:` field denotes an issue that will be marked resolved by merging this PR -->

fixes: #

### How I did it

<!-- Discuss the thought process behind the change -->

### How to verify it

<!-- Discuss any methods that should be used to verify the change -->

### Checklist

<!-- All PRs must complete the following checklist before being merged -->

- [ ] All changes are completed
- [ ] New test cases have been added
- [ ] Documentation has been updated
39 changes: 39 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name-template: '$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

categories:
- title: 'Features'
labels:
- 'feat'
- title: 'Bug Fixes'
labels:
- 'fix'
- title: 'Other updates'
labels:
- 'refactor'
- 'chore'
- 'docs'
- 'perf'
- 'test'

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.

version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch

template: |
## Changes
$CHANGES
Special thanks to: $CONTRIBUTORS
34 changes: 34 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
19 changes: 19 additions & 0 deletions .github/workflows/draft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release Drafter

on:
push:
branches:
- main

jobs:
update-draft:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v6
with:
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/prtitle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PR Title

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
pr-title:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r cz-requirement.txt
- name: Check PR Title
env:
TITLE: ${{ github.event.pull_request.title }}
run: cz check --message "$TITLE"
20 changes: 20 additions & 0 deletions .github/workflows/stale-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Close stale PRs"
on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/stale@v9
with:
stale-pr-message: 'This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days.'
close-pr-message: 'This PR was closed because it has been inactive for 35 days.'
stale-pr-label: "stale"
close-pr-label: "inactive"
days-before-pr-stale: 30
days-before-pr-close: 5
repo-token: ${{ secrets.GITHUB_TOKEN }}
58 changes: 58 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on: ["push", "pull_request"]

name: Test

concurrency:
# Cancel older, in-progress jobs from the same PR, same workflow.
# use run_id if the job is triggered by a push to ensure
# push-triggered jobs to not get canceled.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
linting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint]
- name: Run Black
run: black --check .

- name: Run isort
run: isort --check-only .

- name: Run flake8
run: flake8 .

- name: Run mdformat
run: mdformat . --check

type-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[lint,test]
- name: Run MyPy
run: mypy .

0 comments on commit 4101415

Please sign in to comment.