update git workflows

Former-commit-id: 5a3f26bc53433caa98b2a66294becaf156280a4c
This commit is contained in:
hiyouga 2024-06-08 21:11:32 +08:00
parent 6d9fbb3fa9
commit 82533114a7
2 changed files with 25 additions and 9 deletions

17
.github/workflows/label_issue.yml vendored Normal file
View File

@ -0,0 +1,17 @@
name: label_issue
on:
issues:
types:
- opened
jobs:
label_issue:
runs-on: ubuntu-latest
steps:
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }}
run: |
gh issue edit $ISSUE_URL --add-label "pending"

View File

@ -3,14 +3,7 @@ name: tests
on: on:
push: push:
branches: branches:
- main - $default-branch
paths:
- "**.py"
- "requirements.txt"
- ".github/workflows/*.yml"
pull_request:
branches:
- main
paths: paths:
- "**.py" - "**.py"
- "requirements.txt" - "requirements.txt"
@ -19,21 +12,27 @@ on:
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Checkout
uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.8" python-version: "3.8"
cache: "pip" cache: "pip"
cache-dependency-path: "setup.py" cache-dependency-path: "setup.py"
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install .[torch,dev] python -m pip install .[torch,dev]
- name: Check quality - name: Check quality
run: | run: |
make style && make quality make style && make quality
- name: Test with pytest - name: Test with pytest
run: | run: |
make test make test