From 306058a96bf8fbf205c05de77bbb6523c3491930 Mon Sep 17 00:00:00 2001 From: Raiden Sakura Date: Fri, 22 Dec 2023 22:17:51 +0800 Subject: [PATCH] Update workflow for poetry --- .github/workflows/lint.yml | 2 +- .github/workflows/load-check.yml | 22 ++++++++-------------- .github/workflows/scripts/loadcheck.py | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cd07c9a90e..5fc36a2899 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8"] + python-version: ["3.11"] name: Python ${{ matrix.python-version }} on ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/load-check.yml b/.github/workflows/load-check.yml index 5e80d5e97b..ba5d6df34d 100644 --- a/.github/workflows/load-check.yml +++ b/.github/workflows/load-check.yml @@ -16,24 +16,18 @@ jobs: name: Load Modmail - Python ${{ matrix.python-version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - - name: Cache venv - id: cache-venv + - uses: Gr1N/setup-poetry@v8 + - name: Cache poetry + id: cache-poetry uses: actions/cache@v3 with: - path: .venv - key: ${{ matrix.python-version }}-${{ hashFiles('Pipfile') }}-${{ secrets.CACHE_V }} - - - name: Maybe make pipenv - if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - pip install pipenv && PIPENV_VENV_IN_PROJECT=1 - pipenv install --deploy + path: ~/.cache/pypoetry/virtualenvs + key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} - name: Run script loadcheck.py run: | @@ -49,7 +43,7 @@ jobs: - name: Save Modmail output as Artifact if: always() # still run if prev step failed - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "Modmail log - Python ${{ matrix.python-version }}" path: modmail.log diff --git a/.github/workflows/scripts/loadcheck.py b/.github/workflows/scripts/loadcheck.py index 63dd3b4cac..ff253162c1 100644 --- a/.github/workflows/scripts/loadcheck.py +++ b/.github/workflows/scripts/loadcheck.py @@ -14,7 +14,7 @@ file = open("modmail.log", "w") proc = subprocess.Popen( - "pipenv run bot", + "poetry run bot.py", stdout=file, stderr=subprocess.STDOUT, shell=True,