From d5bbdb3564cd185699f30573d04e36d7a19c2102 Mon Sep 17 00:00:00 2001 From: nnsnodnb Date: Sun, 17 Dec 2023 20:46:02 +0900 Subject: [PATCH] Update actions --- .github/workflows/linter.yml | 16 +++++++------- .github/workflows/release.yml | 17 +++++++++------ .github/workflows/tests.yml | 40 +++++++++++------------------------ 3 files changed, 31 insertions(+), 42 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 899cec1..a949650 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -7,11 +7,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python environment - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: black @@ -25,11 +25,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python environment - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: flake8 @@ -43,11 +43,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python environment - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: mypy @@ -61,11 +61,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python environment - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: isort diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1a2439..9e4c675 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,17 +13,22 @@ jobs: - uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - - name: Install dependencies + - name: Install poetry run: | - python -m pip install -U pip - pip install poetry==1.3.1 - poetry config virtualenvs.in-project true + pip install -U pip pipx + pipx install poetry poetry run pip install -U setuptools pip + - name: Configure poetry + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'poetry' + - name: Build & Publish to PyPI env: API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index caed746..de3cb9a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,10 +5,10 @@ on: jobs: tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] name: Python ${{ matrix.python-version }} tests @@ -16,41 +16,25 @@ jobs: - uses: actions/checkout@v4 - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Get full Python version - id: full-python-version - run: echo "name=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> "{GITHUB_OUTPUT}" - - - name: Bootstrap poetry - shell: bash + - name: Install poetry run: | - python -m ensurepip - python -m pip install --upgrade pip - python -m pip install poetry==1.3.1 + pip install -U pip pipx + pipx install poetry - name: Configure poetry - shell: bash - run: python -m poetry config virtualenvs.in-project true - - - name: Set up cache - uses: actions/cache@v3 - id: cache + uses: actions/setup-python@v5 with: - path: .venv - key: venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} - - - name: Ensure cache is healthy - if: steps.cache.outputs.cache-hit == 'true' - shell: bash - run: timeout 10s python -m poetry run pip --version || rm -rf .venv + python-version: ${{ matrix.python-version }} + cache: 'poetry' - name: Install dependencies shell: bash run: | - python -m poetry install + poetry install --sync --no-root echo "${{ secrets.VOIP_PEM_BASE64 }}" | base64 -d > ./tests/clients/voip/dummy.pem - name: Run pytest @@ -59,8 +43,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} run: | - python -m poetry run python -m pytest -v tests - python -m poetry run coverage report + poetry run python -m pytest -v tests + poetry run coverage report - name: Coveralls Parallel uses: AndreMiras/coveralls-python-action@develop