diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index b1b03ca..b8716b0 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -1,37 +1,35 @@ ---- name: build on: - - push - - pull_request - + - push + - pull_request jobs: - build: - container: - image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest - steps: - - name: Check out repository code - uses: https://gitea.com/BoYanZh/checkout@focs - - name: Display Python3 version - run: python3 --version - - name: Install PDM - run: | - echo curl - curl -sSL https://ghp.ci/https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py -o install-pdm.py - echo sed - sed -i 's|https://github.com|https://ghp.ci/https://github.com|g' install-pdm.py - echo python3 - python3 install-pdm.py -p /usr - - name: Display PDM version - run: pdm --version - - name: PDM install dependencies - run: | - pdm install - - name: Lint - run: | - pdm run lint - - name: Test - run: | - pdm run test - - name: Run - run: | - pdm run app --help + build: + container: + image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest + steps: + - name: Check out repository code + uses: https://gitea.com/BoYanZh/checkout@focs + - name: Display Python3 version + run: python3 --version + - name: Install PDM + run: | + echo curl + curl -sSL https://ghp.ci/https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py -o install-pdm.py + echo sed + sed -i 's|https://github.com|https://ghp.ci/https://github.com|g' install-pdm.py + echo python3 + python3 install-pdm.py -p /usr + - name: Display PDM version + run: pdm --version + - name: PDM install dependencies + run: | + pdm install + - name: Lint + run: | + pdm run lint + - name: Test + run: | + pdm run test + - name: Run + run: | + pdm run app --help diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 603c0cc..525157d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,60 +1,59 @@ ---- repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: check-yaml - - id: check-toml - - id: end-of-file-fixer - - id: trailing-whitespace - - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.5 - hooks: - - id: remove-crlf - - id: remove-tabs - - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - rev: 0.2.3 - hooks: - - id: yamlfmt - - repo: https://github.com/pdm-project/pdm - rev: 2.19.2 - hooks: - - id: pdm-lock-check - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 - hooks: - - id: mypy - additional_dependencies: - - pydantic - - types-PyYAML - - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 - hooks: - - id: pyupgrade - - repo: https://github.com/hadialqattan/pycln - rev: v2.4.0 - hooks: - - id: pycln - - repo: https://github.com/PyCQA/bandit - rev: 1.7.10 - hooks: - - id: bandit - args: [-c, pyproject.toml] - additional_dependencies: ['bandit[toml]'] - - repo: https://github.com/PyCQA/isort - rev: 5.13.2 - hooks: - - id: isort - args: [--profile, black, --filter-files] - - repo: https://github.com/psf/black - rev: 24.8.0 - hooks: - - id: black - # - repo: local - # hooks: - # - id: pytest-check - # name: pytest-check - # entry: pdm run test - # language: system - # pass_filenames: false - # always_run: true + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-yaml + - id: check-toml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.5 + hooks: + - id: remove-crlf + - id: remove-tabs + - repo: https://github.com/google/yamlfmt + rev: v0.13.0 + hooks: + - id: yamlfmt + - repo: https://github.com/pdm-project/pdm + rev: 2.19.2 + hooks: + - id: pdm-lock-check + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.11.2 + hooks: + - id: mypy + additional_dependencies: + - pydantic + - types-PyYAML + - repo: https://github.com/asottile/pyupgrade + rev: v3.17.0 + hooks: + - id: pyupgrade + - repo: https://github.com/hadialqattan/pycln + rev: v2.4.0 + hooks: + - id: pycln + - repo: https://github.com/PyCQA/bandit + rev: 1.7.10 + hooks: + - id: bandit + args: [-c, pyproject.toml] + additional_dependencies: ["bandit[toml]"] + - repo: https://github.com/PyCQA/isort + rev: 5.13.2 + hooks: + - id: isort + args: [--profile, black, --filter-files] + - repo: https://github.com/psf/black + rev: 24.8.0 + hooks: + - id: black +# - repo: local +# hooks: +# - id: pytest-check +# name: pytest-check +# entry: pdm run test +# language: system +# pass_filenames: false +# always_run: true