diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 351a58b..0d3db51 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -11,9 +11,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - name: Install poetry + run: | + curl -O -sSL https://install.python-poetry.org/install-poetry.py + python install-poetry.py -y --version 1.3.1 + echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV + rm install-poetry.py + - uses: actions/setup-python@v4 with: python-version: "3.10" - - run: pip install poetry==1.3.1 + cache: "poetry" + - run: poetry env use python3.10 - run: poetry install --with docs - run: poetry run mkdocs gh-deploy --force --clean --verbose diff --git a/.github/workflows/code-cov.yml b/.github/workflows/code-cov.yml index 242b00f..52d7b54 100644 --- a/.github/workflows/code-cov.yml +++ b/.github/workflows/code-cov.yml @@ -1,18 +1,27 @@ name: CodeCov + on: [pull_request] + jobs: run: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 + - name: Install poetry + run: | + curl -O -sSL https://install.python-poetry.org/install-poetry.py + python install-poetry.py -y --version 1.3.1 + echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV + rm install-poetry.py - name: Set up Python 3.10 - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: "3.10" + cache: "poetry" - name: Install dependencies and project run: | - python -m pip install poetry==1.3.1 + poetry env use python3.10 poetry install --with test - name: Run tests and collect coverage run: poetry run pytest --cov blitzly --cov-report term-missing --cov-report xml diff --git a/.github/workflows/deploy-package.yml b/.github/workflows/deploy-package.yml index 53c5807..3fbba99 100644 --- a/.github/workflows/deploy-package.yml +++ b/.github/workflows/deploy-package.yml @@ -12,9 +12,16 @@ jobs: environment: deploy-package steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - name: Install poetry + run: | + curl -O -sSL https://install.python-poetry.org/install-poetry.py + python install-poetry.py -y --version 1.3.1 + echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV + rm install-poetry.py + - uses: actions/setup-python@v4 with: python-version: "3.10" - - run: pip install poetry==1.3.1 + cache: "poetry" + - run: poetry env use python3.10 - run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} - run: poetry publish --build diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 584d9fa..287b517 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: deepakputhraya/action-pr-title@master with: - regex: "^(build:|ci:|docs:|feat:|fix:|bug:|perf:|refactor:|revert:|style:|test:|security:).{12,60}$" + regex: "^(add:|build:|ci:|docs:|feat:|fix:|bug:|perf:|refactor:|revert:|style:|test:|security:).{12,60}$" min_length: 10 max_length: 60 github_token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index ff0b408..658e19b 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -9,9 +9,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - name: Install poetry + run: | + curl -O -sSL https://install.python-poetry.org/install-poetry.py + python install-poetry.py -y --version 1.3.1 + echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV + rm install-poetry.py + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: "poetry" - name: Install dependencies and project run: | - python -m pip install poetry==1.3.1 + poetry env use python3.10 poetry install - uses: pre-commit/action@v3.0.0 + env: + SKIP: poetry-lock,poetry-export diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index a05fb27..d6bb194 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,13 +13,24 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install poetry + run: | + curl -O -sSL https://install.python-poetry.org/install-poetry.py + python install-poetry.py -y --version 1.3.1 + echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV + rm install-poetry.py + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: "poetry" - name: Install dependencies and project run: | - python -m pip install poetry==1.3.1 + poetry env use ${{ matrix.python-version }} poetry install --with test - name: Check with isort run: | @@ -38,4 +49,4 @@ jobs: poetry run pylint --rcfile=pyproject.toml ./src/blitzly ./tests - name: Test with pytest run: | - poetry run pytest --cov blitzly --cov-fail-under=90 --cov-report term-missing + poetry run pytest --cov src/blitzly --cov-fail-under=90 --cov-report term-missing diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8dd7292..a1e1372 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,6 @@ +default_language_version: + python: python3.10 + repos: - repo: https://github.com/compilerla/conventional-pre-commit rev: v2.1.1 @@ -21,7 +24,7 @@ repos: ] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -77,7 +80,7 @@ repos: - "-r" - repo: https://github.com/python-poetry/poetry - rev: 1.3.1 + rev: 1.3.0 hooks: - id: poetry-check - id: poetry-lock