From 7897625d690daee1c15b293d9333cdfa970d7710 Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Thu, 10 Jun 2021 23:37:53 +0800 Subject: [PATCH] feat: add ci --- .github/workflows/python-package.yml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..b4c20a9 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,29 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: [ push ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Cache environment + uses: actions/cache@v2 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-${{ env.pythonLocation }} + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -e .; fi