refactor: upgrade Python version to 3.11 (#32) #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
env: | |
SRC_CODE: star_rail | |
TEST_CODE: tests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'star_rail/**' | |
- 'tests/**' | |
pull_request: | |
paths: | |
- 'star_rail/**' | |
- 'tests/**' | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
isort: | |
name: isort | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- run: python -m pip install isort | |
- name: isort | |
uses: liskin/gh-problem-matcher-wrap@v2 | |
with: | |
linters: isort | |
run: isort --check --diff ${{ env.SRC_CODE }} ${{ env.TEST_CODE }} | |
flake8: | |
name: flake8 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python version | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- run: python -m pip install flake8 | |
- name: flake8 | |
uses: liskin/gh-problem-matcher-wrap@v2 | |
with: | |
linters: flake8 | |
run: flake8 ${{ env.SRC_CODE }} ${{ env.TEST_CODE }} | |
black: | |
name: black | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: black | |
uses: psf/black@stable | |
with: | |
options: "${{ env.SRC_CODE }} ${{ env.TEST_CODE }}" | |
pytest: | |
needs: [isort, flake8, black] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python version | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
cache: 'poetry' | |
- name: Install dependencies | |
run: poetry install --with test --without dev,release | |
- name: Run pytest | |
run: poetry run pytest --cov=${{ env.SRC_CODE }} ${{ env.TEST_CODE }} --no-cov-on-fail |