From babcd220eaae8383facf3b93516703a26825db46 Mon Sep 17 00:00:00 2001 From: Zhang Jie <13131481+j-z10@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:59:57 +0800 Subject: [PATCH] Update unittest.yml --- .github/workflows/unittest.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index d4350c8..6613e9e 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -13,18 +13,22 @@ jobs: pep8: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v5 + - name: Check out repository + uses: actions/checkout@v4 with: - python-version: 3.12 - - name: Install Python dependencies - run: | - python -m pip install poetry - poetry install --sync --with dev - - name: Lint with flake8 - run: | - poetry run flake8 . --count + ref: ${{ github.head_ref }} + fetch-depth: 0 + - name: autopep8 + id: autopep8 + uses: j-z10/autopep8@669deac37f8d1de9629679e31ba700a35eebd042 + with: + args: --exit-code --recursive --in-place . + - name: Fail if autopep8 detected issues + if: steps.autopep8.outputs.exit-code == 2 + uses: actions/github-script@v7 + with: + script: | + core.setFailed('Code style issues found.') test: needs: pep8