Skip to content

Commit

Permalink
🎉 Start the journey
Browse files Browse the repository at this point in the history
  • Loading branch information
BalconyJH committed Nov 15, 2024
1 parent 5399276 commit 8c9a676
Show file tree
Hide file tree
Showing 46 changed files with 3,390 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Bug 反馈
title: "Bug: 出现异常"
description: 提交 Bug 反馈以帮助我们改进代码
labels: ["bug"]
body:
- type: dropdown
id: env-os
attributes:
label: 操作系统
description: 选择运行 aioarxiv 的系统
options:
- Windows
- MacOS
- Linux
- Other
validations:
required: true

- type: input
id: env-python-ver
attributes:
label: Python 版本
description: 填写运行 aioarxiv 的 Python 版本
placeholder: e.g. 3.11.0
validations:
required: true

- type: input
id: env-nb-ver
attributes:
label: aioarxiv 版本
description: 填写 aioarxiv 版本
placeholder: e.g. 0.1.0
validations:
required: true

- type: textarea
id: describe
attributes:
label: 描述问题
description: 清晰简洁地说明问题是什么
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: 复现步骤
description: 提供能复现此问题的详细操作步骤
placeholder: |
1. 首先……
2. 然后……
3. 发生……
validations:
required: true

- type: textarea
id: expected
attributes:
label: 期望的结果
description: 清晰简洁地描述你期望发生的事情

- type: textarea
id: logs
attributes:
label: 截图或日志
description: 提供有助于诊断问题的任何日志和截图
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/document.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 文档改进
title: "Docs: 描述"
description: 文档错误及改进意见反馈
labels: ["documentation"]
body:
- type: textarea
id: problem
attributes:
label: 描述问题或主题
validations:
required: true

- type: textarea
id: improve
attributes:
label: 需做出的修改
validations:
required: true
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 功能建议
title: "Feature: 功能描述"
description: 提出关于项目新功能的想法
labels: ["enhancement"]
body:
- type: textarea
id: problem
attributes:
label: 希望能解决的问题
description: 在使用中遇到什么问题而需要新的功能?
validations:
required: true

- type: textarea
id: feature
attributes:
label: 描述所需要的功能
description: 请说明需要的功能或解决方法
validations:
required: true
36 changes: 36 additions & 0 deletions .github/actions/build-api-doc/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build documentation
description: Build documentation

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

env:
INSTANCE: 'Writerside/hi'
ARTIFACT: 'webHelpHI2-all.zip'
DOCKER_VERSION: '243.21565'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build docs using Writerside Docker builder
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.DOCKER_VERSION }}

- name: Save artifact with build results
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
retention-days: 7
13 changes: 13 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Setup Node
description: Setup Node

runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"

- run: yarn install --frozen-lockfile
shell: bash
37 changes: 37 additions & 0 deletions .github/actions/setup-python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Setup Python
description: Setup Python

inputs:
python-version:
description: Python version
required: false
default: "3.10"
env-dir:
description: Environment directory
required: false
default: "."
no-root:
description: Do not install package in the environment
required: false
default: "false"

runs:
using: "composite"
steps:
- name: Install pdm
run: pipx install pdm
shell: bash

- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: "pdm"
cache-dependency-path: |
./pdm.lock
${{ inputs.env-dir }}/pdm.lock
- run: |
cd ${{ inputs.env-dir }}
pdm install --all
fi
shell: bash
54 changes: 54 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Code Coverage

on:
push:
branches:
- master
pull_request:
paths:
- "envs/**"
- "src/**"
- "tests/**"
- ".github/workflows/codecov.yml"
- "pyproject.toml"
- "pdm.lock"

jobs:
test:
name: Test Coverage
runs-on: ${{ matrix.os }}
concurrency:
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.env }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4

- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
env-dir: ./envs/${{ matrix.env }}
no-root: true

- name: Run Pytest
run: |
cd ./envs/${{ matrix.env }}
poetry run bash "../../scripts/run-tests.sh"
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
files: ./tests/coverage.xml
flags: unittests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Pyright Lint

on:
push:
branches:
- master
pull_request:
paths:
- "envs/**"
- "src/**"
- "tests/**"
- ".github/actions/setup-python/**"
- ".github/workflows/pyright.yml"
- "pyproject.toml"
- "pdm.lock"

jobs:
pyright:
name: Pyright Lint
runs-on: ubuntu-latest
concurrency:
group: pyright-${{ github.ref }}-${{ matrix.env }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4

- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
env-dir: ./envs/${{ matrix.env }}
no-root: true

- name: Run Pyright
uses: jakebailey/pyright-action@v2
29 changes: 29 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Ruff Lint

on:
push:
branches:
- master
pull_request:
paths:
- "envs/**"
- "src/**"
- "tests/**"
- ".github/actions/setup-python/**"
- ".github/workflows/ruff.yml"
- "pyproject.toml"
- "pdm.lock"

jobs:
ruff:
name: Ruff Lint
runs-on: ubuntu-latest
concurrency:
group: pyright-${{ github.ref }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v4

- name: Run Ruff Lint
uses: chartboost/ruff-action@v1
46 changes: 46 additions & 0 deletions .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#name: Site Deploy
#
#on:
# push:
# branches:
# - master
#
#jobs:
# publish:
# runs-on: ubuntu-latest
# concurrency:
# group: website-deploy-${{ github.ref }}
# cancel-in-progress: true
#
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# - name: Setup Python Environment
# uses: ./.github/actions/setup-python
#
# - name: Setup Node Environment
# uses: ./.github/actions/setup-node
#
# - name: Build API Doc
# uses: ./.github/actions/build-api-doc
#
# - name: Build Doc
# run: yarn build
#
# - name: Get Branch Name
# run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
#
# - name: Deploy to Netlify
# uses: nwtgck/actions-netlify@v3
# with:
# publish-dir: "./website/build"
# production-deploy: true
# github-token: ${{ secrets.GITHUB_TOKEN }}
# deploy-message: "Deploy ${{ env.BRANCH_NAME }}@${{ github.sha }}"
# enable-commit-comment: false
# alias: ${{ env.BRANCH_NAME }}
# env:
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# NETLIFY_SITE_ID: ${{ secrets.SITE_ID }}
Loading

0 comments on commit 8c9a676

Please sign in to comment.