ci: Update tdgpt-ci.yml

Adjust the working-directory as job level
This commit is contained in:
Feng Chao 2025-03-11 09:57:50 +08:00 committed by GitHub
parent 9e248bcf91
commit cef8c45eb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 4 deletions

View File

@ -10,6 +10,7 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
working-directory: ${{ github.workspace }}/tools/tdgpt
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -25,19 +26,16 @@ jobs:
cache: 'pip' cache: 'pip'
- name: Install dependencies - name: Install dependencies
working-directory: ${{ github.workspace }}/tools/tdgpt
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
python -m pip install flake8 pytest pylint python -m pip install flake8 pytest pylint
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Checking the code with pylint - name: Checking the code with pylint
working-directory: ${{ github.workspace }}/tools/tdgpt
run: | run: |
pylint $(git ls-files '*.py') --exit-zero pylint $(git ls-files '*.py') --exit-zero
- name: Checking the code with flake8 - name: Checking the code with flake8
working-directory: ${{ github.workspace }}/tools/tdgpt
run: | run: |
# stop the build if there are Python syntax errors or undefined names # stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
@ -45,6 +43,5 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run test cases with pytest - name: Run test cases with pytest
working-directory: ${{ github.workspace }}/tools/tdgpt
run: | run: |
pytest pytest