From eddedc9c31b5003383b1ab6e98ab76f7c1a0703e Mon Sep 17 00:00:00 2001 From: Yohei Okabayashi Date: Sat, 7 Sep 2024 23:21:31 +0900 Subject: [PATCH] ADD: add github actions and template --- .github/ISSUE_TEMPLATE/bug_report.md | 27 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 22 ++++++++++++++++ .github/dependabot.yml | 17 +++++++++++++ .github/pull_request_tamplate.md | 16 ++++++++++++ .github/workflows/pr_agent.yml | 24 ++++++++++++++++++ .github/workflows/python-lint.yml | 31 +++++++++++++++++++++++ 6 files changed, 137 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/dependabot.yml create mode 100644 .github/pull_request_tamplate.md create mode 100644 .github/workflows/pr_agent.yml create mode 100644 .github/workflows/python-lint.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..df012b7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +## Description + + +## Steps to Reproduce + +1. Step one +2. Step two +3. Step three +4. ... + +## Expected Behavior + + +## Actual Behavior + + +## Screenshots or Logs + + +## Environment + +- OS: [e.g., Windows, macOS, Linux] +- Browser: [e.g., Chrome, Firefox] +- Version: [e.g., 22] + +## Additional Context + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..fc92cc1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,22 @@ +## Summary + + +## Background & Problem + + +## Expected Benefits + + +## Implementation Details + +- Feature A: Describe an example +- Feature B: Describe another example + +## Alternatives + + +## Related Issues or PRs + + +## Additional Information + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b9a77c5 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +version: 2 +updates: + # python + - package-ecosystem: "pip" + directory: "src/" + schedule: + interval: "monthly" + # terraform + - package-ecosystem: "terraform" + directory: "terraform/" + schedule: + interval: "monthly" + # github actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/pull_request_tamplate.md b/.github/pull_request_tamplate.md new file mode 100644 index 0000000..a4158d3 --- /dev/null +++ b/.github/pull_request_tamplate.md @@ -0,0 +1,16 @@ +## Summary + + +## Related Issues + + +## Changes + +- Change 1 +- Change 2 + +## How to Test + + +## Additional Context + diff --git a/.github/workflows/pr_agent.yml b/.github/workflows/pr_agent.yml new file mode 100644 index 0000000..eb17f59 --- /dev/null +++ b/.github/workflows/pr_agent.yml @@ -0,0 +1,24 @@ +on: + pull_request: + types: [opened, reopened, ready_for_review] +jobs: + pr_agent_job: + if: ${{ github.event.sender.type != 'Bot' }} + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + issues: write + pull-requests: write + contents: write + name: Run pr agent on every pull request, respond to user comments + steps: + - name: PR Agent action step + id: pragent + uses: Codium-ai/pr-agent@main + env: + OPENAI_KEY: ${{ secrets.OPENAI_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CONFIG.MODEL: "gpt-4o-mini" + CONFIG.MODEL_TURBO: "gpt-4o-mini" + PR_DESCRIPTION.publish_labels: false + PR_REVIEW.INLINE_CODE_COMMENTS: true diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml new file mode 100644 index 0000000..2495733 --- /dev/null +++ b/.github/workflows/python-lint.yml @@ -0,0 +1,31 @@ +name: Python Lint +on: + pull_request: + push: + branches: + - "main" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + python-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: actions/cache@v4 + with: + path: ~/.cache/uv + key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }} + restore-keys: | + ${{ runner.os }}-uv- + - name: Lint with ruff + run: pip install uv + - name: Check ruff + run: uvx ruff check . + # - name: Check mypy + # run: uvx mypy .