From 54f14f6c6fd22a4b050e5e9dabe7c4527ee7d534 Mon Sep 17 00:00:00 2001 From: everpcpc Date: Wed, 17 Jan 2024 10:39:51 +0800 Subject: [PATCH] chore(ci): separate build & publish and add lint --- .github/workflows/python.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a37724c..e00c2bb 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -18,8 +18,31 @@ concurrency: cancel-in-progress: true jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install pipenv + run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Lint + working-directory: python + run: | + pipenv install --dev + pipenv run flake8 databend_udf + pipenv run black --check databend_udf + - name: build + working-directory: python + run: | + python -m pip install build + python -m build + publish: runs-on: ubuntu-latest + needs: test + if: github.event_name == 'push' permissions: contents: read id-token: write @@ -34,7 +57,6 @@ jobs: python -m pip install build python -m build - uses: pypa/gh-action-pypi-publish@release/v1 - if: github.event_name == 'push' with: packages-dir: python/dist/ skip-existing: true