From a4eec90ba4fd9ac667c69dff2e66f3e1f339bb4e Mon Sep 17 00:00:00 2001 From: WANG Xu Date: Tue, 11 Mar 2025 15:24:06 +0800 Subject: [PATCH] fix: working directory at job level Signed-off-by: WANG Xu --- .github/workflows/tdgpt-ci.yml | 54 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tdgpt-ci.yml b/.github/workflows/tdgpt-ci.yml index 02c1c5889f..4a438938dc 100644 --- a/.github/workflows/tdgpt-ci.yml +++ b/.github/workflows/tdgpt-ci.yml @@ -1,6 +1,6 @@ -name: TDGpt CI Pipeline +name: TDgpt CI -on: +on: pull_request: branches: - '3.0' @@ -10,38 +10,42 @@ on: jobs: build: runs-on: ubuntu-latest - working-directory: ${{ github.workspace }}/tools/tdgpt + strategy: fail-fast: false matrix: python-version: ["3.10"] + defaults: + run: + working-directory: ${{ github.workspace }}/tools/tdgpt + steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest pylint - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest pylint + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Checking the code with pylint - run: | - pylint $(git ls-files '*.py') --exit-zero + - name: Checking the code with pylint + run: | + pylint $(git ls-files '*.py') --exit-zero - - name: Checking the code with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Checking the code with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Run test cases with pytest - run: | + - name: Run test cases with pytest + run: | pytest