From 99fd49c97483faf0dad4b6ed04dc14cea1083589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zeyan=20Li=20=E6=9D=8E=E5=88=99=E8=A8=80?= Date: Thu, 7 Mar 2024 14:57:15 +0800 Subject: [PATCH] ci(update CI configurations): --- .github/workflows/pythonpackage.yml | 61 ++++++++++++++++------------- .idea/GitCommitMessageStorage.xml | 8 ++++ .idea/git_toolbox_prj.xml | 15 +++++++ 3 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 .idea/GitCommitMessageStorage.xml create mode 100644 .idea/git_toolbox_prj.xml diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 9742687..17840f2 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -3,7 +3,7 @@ name: Python package -on: [push, pull_request] +on: [ push, pull_request ] jobs: test: @@ -11,32 +11,37 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, 3.10, 3.11, 3.12] + python-version: [ 3.9, 3.10, 3.11, 3.12 ] + poetry-version: [ 1.8.2 ] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Cache pip - uses: actions/cache@v2 - with: - path: ~/.cache/pip # This path is specific to Ubuntu - # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }} - - name: Install dependencies - run: | - pip install -U poetry - poetry install - - name: Test with pytest - run: | - PYTHONPATH=$(realpath .) coverage run -m pytest tests - - name: Genrate Coverage Report - run: | - PYTHONPATH=$(realpath .) coverage report - - name: Coveralls - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - run: | - coveralls + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Poetry Image + uses: abatilo/actions-poetry@v2 + with: + poetry-version: ${{ matrix.poetry-version }} + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip # This path is specific to Ubuntu + # Look to see if there is a cache hit for the corresponding requirements file + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }} + - name: Install dependencies + run: | + poetry config virtualenvs.create false + poetry install + - name: Test with pytest + run: | + PYTHONPATH=$(realpath .) coverage run -m pytest tests + - name: Genrate Coverage Report + run: | + PYTHONPATH=$(realpath .) coverage report + - name: Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + run: | + coveralls diff --git a/.idea/GitCommitMessageStorage.xml b/.idea/GitCommitMessageStorage.xml new file mode 100644 index 0000000..e4fd56a --- /dev/null +++ b/.idea/GitCommitMessageStorage.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml new file mode 100644 index 0000000..02b915b --- /dev/null +++ b/.idea/git_toolbox_prj.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file