Skip to content

Merge pull request #1 from hiwakaba/main #5

Merge pull request #1 from hiwakaba/main

Merge pull request #1 from hiwakaba/main #5

# -*- coding: utf-8 -*-
#
# K2HDKC DBaaS based on Trove
#
# Copyright (c) 2020 Yahoo Japan Corporation
# Copyright 2024 LY Corporation
#
# For the full copyright and license information, please view
# the license file that was distributed with this source code.
#
# AUTHOR: Hirotaka Wakabayashi
# CREATE: Mon Sep 14 2020
# REVISION:
#
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/k2hr3client
permissions:
id-token: write
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.11", "3.10", "3.9"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: Install dependencies
run: |
make init
shell: sh
- name: Install dependencies in GHA
run: |
python -m pip install --upgrade pip
pipenv install --deploy --dev
- name: Lint with pylint
run: |
pipenv run flake8 src/k2hr3client
pipenv run mypy src/k2hr3client
pipenv run pylint src/k2hr3client
pipenv run python3 setup.py checkdocs
shell: sh
- name: Test with unittest
run: |
pipenv run python3 -m unittest discover src
shell: sh
- name: Install dependencies for upload pypi package
if: startsWith(github.ref, 'refs/tags')
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
if: startsWith(github.ref, 'refs/tags')
run: python -m build
- name: Publish distribution to PyPI
if: ${{ matrix.python-version == '3.11' && startsWith(github.ref, 'refs/tags') }}
uses: pypa/gh-action-pypi-publish@release/v1
#
# Local variables:
# tab-width: 4
# c-basic-offset: 4
# End:
# vim600: expandtab sw=4 ts=4 fdm=marker
# vim<600: expandtab sw=4 ts=4
#