Skip to content

Commit

Permalink
Update workflow for poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
raidensakura committed Dec 22, 2023
1 parent 4c89469 commit 306058a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/load-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/scripts/loadcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 306058a

Please sign in to comment.