Skip to content

Commit 8254c5b

Browse files
authored
infra: update readme and action (#77)
* update doc and github action * update doc and github action * update doc and github action * update doc and github action * update doc and github action * update doc and github action
1 parent ed4ee28 commit 8254c5b

File tree

11 files changed

+875
-235
lines changed

11 files changed

+875
-235
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 🐞 Bug Report
2+
description: File a bug report
3+
title: "[Bug]: "
4+
type: "Bug"
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for stopping by to let us know something could be better!
10+
- type: textarea
11+
id: what-happened
12+
attributes:
13+
label: What happened?
14+
description: Also tell us what you expected to happen and how to reproduce the issue.
15+
placeholder: Tell us what you see!
16+
value: "A bug happened!"
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: logs
21+
attributes:
22+
label: Relevant log output
23+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
24+
render: shell
25+
- type: checkboxes
26+
id: terms
27+
attributes:
28+
label: Code of Conduct
29+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/MetaGLM/zhipuai-sdk-python-v4/blob/main/CODE_OF_CONDUCT.md)
30+
options:
31+
- label: I agree to follow this project's Code of Conduct
32+
required: true
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 💡 Feature Request
2+
description: Suggest an idea for this repository
3+
title: "[Feat]: "
4+
type: "Feature"
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for stopping by to let us know something could be better!
10+
- type: textarea
11+
id: problem
12+
attributes:
13+
label: Is your feature request related to a problem? Please describe.
14+
description: A clear and concise description of what the problem is.
15+
placeholder: Ex. I'm always frustrated when [...]
16+
- type: textarea
17+
id: describe
18+
attributes:
19+
label: Describe the solution you'd like
20+
description: A clear and concise description of what you want to happen.
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: alternatives
25+
attributes:
26+
label: Describe alternatives you've considered
27+
description: A clear and concise description of any alternative solutions or features you've considered.
28+
- type: textarea
29+
id: context
30+
attributes:
31+
label: Additional context
32+
description: Add any other context or screenshots about the feature request here.
33+
- type: checkboxes
34+
id: terms
35+
attributes:
36+
label: Code of Conduct
37+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/MetaGLM/zhipuai-sdk-python-v4/blob/main/CODE_OF_CONDUCT.md)
38+
options:
39+
- label: I agree to follow this project's Code of Conduct
40+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Description
2+
3+
Thank you for opening a Pull Request!
4+
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
5+
6+
- [ ] Follow the [`CONTRIBUTING` Guide](https://github.com/MetaGLM/zhipuai-sdk-python-v4/blob/main/CONTRIBUTING.md).
7+
- [ ] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification.
8+
- [ ] Ensure the tests pass (Run `mvn clean test` from the repository root)
9+
- [ ] Appropriate docs were updated (if necessary)
10+
11+
Fixes #<issue_number_goes_here>

.github/actions/poetry_setup/action.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,15 @@ runs:
6969
/opt/pipx/venvs/poetry/bin/python --version
7070
/opt/pipx_bin/poetry --version
7171
72-
- name: Fix pip and upgrade pipx
73-
if: steps.cache-bin-poetry.outputs.cache-hit != 'true'
74-
shell: bash
75-
run: |
76-
python -m pip install --upgrade "pip<25"
77-
python -m pip install --upgrade pipx
78-
pipx --version
79-
80-
- name: Install poetry
72+
- name: Install poetry via pip
8173
if: steps.cache-bin-poetry.outputs.cache-hit != 'true'
8274
shell: bash
8375
env:
8476
POETRY_VERSION: ${{ inputs.poetry-version }}
85-
PYTHON_VERSION: ${{ inputs.python-version }}
86-
# Install poetry using the python version installed by setup-python step.
87-
run: pipx install "poetry==$POETRY_VERSION" --python '${{ steps.setup-python.outputs.python-path }}' --verbose
77+
run: |
78+
python -m pip install --upgrade pip
79+
python -m pip install "poetry==$POETRY_VERSION"
80+
poetry --version
8881
8982
- name: Restore pip and poetry cached dependencies
9083
uses: actions/cache@v4

.github/workflows/_test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ on:
88
type: string
99
default: '.'
1010
description: "From which folder this pipeline executes"
11+
pull_request:
12+
branches:
13+
- main
14+
push:
15+
branches:
16+
- 'action*'
1117

1218
env:
1319
POETRY_VERSION: "1.8.2"
@@ -16,7 +22,7 @@ jobs:
1622
build:
1723
defaults:
1824
run:
19-
working-directory: ${{ inputs.working-directory }}
25+
working-directory: ${{ inputs.working-directory || '.' }}
2026
runs-on: ubuntu-latest
2127
strategy:
2228
matrix:
@@ -35,13 +41,13 @@ jobs:
3541
with:
3642
python-version: ${{ matrix.python-version }}
3743
poetry-version: ${{ env.POETRY_VERSION }}
38-
working-directory: ${{ inputs.working-directory }}
44+
working-directory: ${{ inputs.working-directory || '.' }}
3945
cache-key: core
4046

4147

4248
- name: Import test dependencies
4349
run: poetry install --with test
44-
working-directory: ${{ inputs.working-directory }}
50+
working-directory: ${{ inputs.working-directory || '.' }}
4551

4652
- name: Run core tests
4753
shell: bash

.github/workflows/lint-pr.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "Lint PR"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
10+
jobs:
11+
lint-pr:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: read
16+
steps:
17+
- uses: amannn/action-semantic-pull-request@v5
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CODE_OF_CONDUCT.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of
9+
experience, education, socio-economic status, nationality, personal appearance,
10+
race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or reject
41+
comments, commits, code, wiki edits, issues, and other contributions that are
42+
not aligned to this Code of Conduct, or to ban temporarily or permanently any
43+
contributor for other behaviors that they deem inappropriate, threatening,
44+
offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
This Code of Conduct also applies outside the project spaces when the Project
56+
Steward has a reasonable belief that an individual's behavior may have a
57+
negative impact on the project or its community.
58+
59+
## Conflict Resolution
60+
61+
We do not believe that all conflict is bad; healthy debate and disagreement
62+
often yield positive results. However, it is never okay to be disrespectful or
63+
to engage in behavior that violates the project’s code of conduct.
64+
65+
If you see someone violating the code of conduct, you are encouraged to address
66+
the behavior directly with those involved. Many issues can be resolved quickly
67+
and easily, and this gives people more control over the outcome of their
68+
dispute. If you are unable to resolve the matter for any reason, or if the
69+
behavior is threatening or harassing, report it. We are dedicated to providing
70+
an environment where participants feel welcome and safe.
71+
72+
Reports should be directed to *[PROJECT STEWARD NAME(s) AND EMAIL(s)]*, the
73+
Project Steward(s) for *[PROJECT NAME]*. It is the Project Steward’s duty to
74+
receive and address reported violations of the code of conduct. They will then
75+
work with a committee consisting of representatives from the Open Source
76+
Programs Office and the Z.ai Open Source Strategy team.
77+
78+
We will investigate every complaint, but you may not receive a direct response.
79+
We will use our discretion in determining when and how to follow up on reported
80+
incidents, which may range from not taking action to permanent expulsion from
81+
the project and project-sponsored spaces. We will notify the accused of the
82+
report and provide them an opportunity to discuss it before any action is taken.
83+
The identity of the reporter will be omitted from the details of the report
84+
supplied to the accused. In potentially harmful situations, such as ongoing
85+
harassment or threats to anyone's safety, we may take action without notice.
86+
87+
## Attribution
88+
89+
This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
90+
available at
91+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# How to contribute
2+
3+
We'd love to accept your patches and contributions to this project.
4+
5+
## Contribution process
6+
7+
### Code reviews
8+
9+
All submissions, including submissions by project members, require review. We
10+
use GitHub pull requests for this purpose. Consult
11+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
12+
information on using pull requests.
13+
14+
### Contributor Guide
15+
16+
You may follow these steps to contribute:
17+
18+
1. **Fork the official repository.** This will create a copy of the official repository in your own account.
19+
2. **Sync the branches.** This will ensure that your copy of the repository is up-to-date with the latest changes from the official repository.
20+
3. **Work on your forked repository's feature branch.** This is where you will make your changes to the code.
21+
4. **Commit your updates on your forked repository's feature branch.** This will save your changes to your copy of the repository.
22+
5. **Submit a pull request to the official repository's main branch.** This will request that your changes be merged into the official repository.
23+
6. **Resolve any linting errors.** This will ensure that your changes are formatted correctly.
24+
25+
Here are some additional things to keep in mind during the process:
26+
27+
- **Test your changes.** Before you submit a pull request, make sure that your changes work as expected.
28+
- **Be patient.** It may take some time for your pull request to be reviewed and merged.
29+
30+
31+
32+
33+
34+
Have Fun!
35+
---

0 commit comments

Comments
 (0)