Skip to content

Commit

Permalink
ci: enable caching
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislemke committed Jan 4, 2023
1 parent be14cb8 commit c1bf46f
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 96 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@ name: BuildDocs
on:
push:
branches:
- main
- "main"

jobs:
deploy:
if: ${{ startsWith(github.event.head_commit.message, 'chore(main)') }}
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.9
- run: pip install poetry==1.3.0
python-version: "3.10"
cache: "poetry"
- run: poetry env use python3.10
- run: poetry install --with docs
- run: poetry run mkdocs gh-deploy --force --clean --verbose
16 changes: 13 additions & 3 deletions .github/workflows/deploy-package.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
name: DeployPackage

on:
push:
branches:
- main
- "main"

jobs:
deploy:
if: ${{ startsWith(github.event.head_commit.message, 'chore(main)') }}
runs-on: ubuntu-latest
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.AUTOEMBEDDER_UPLOAD_TOKEN }}
- run: poetry publish --build
4 changes: 2 additions & 2 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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,30}$"
regex: "^(add:|build:|ci:|docs:|feat:|fix:|bug:|perf:|refactor:|revert:|style:|test:|security:).{12,60}$"
min_length: 10
max_length: 20
max_length: 60
github_token: "${{ secrets.GITHUB_TOKEN }}"
15 changes: 13 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
prerelease: true
default-branch: main
pull-request-header: ":robot: I have created a release *beep* *boop*. This was predictable."
changelog-types: '[{"type":"add","section":"Features","hidden":false},{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"bug","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":true},{"type":"test","section":"Tests","hidden":false},{"type":"ci","section":"CI/CD","hidden":false},{"type":"refactor","section":"Maintenance","hidden":false},{"type":"perf","section":"Maintenance","hidden":false},{"type":"revert","section":"Maintenance","hidden":false},{"type":"docs","section":"Documentation","hidden":false},{"type":"security","section":"Security","hidden":false}]'
changelog-types: '[{"type":"merge","section":"Miscellaneous","hidden":true},{"type":"resolve","section":"Miscellaneous","hidden":true},{"type":"add","section":"Features","hidden":false},{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"bug","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":true},{"type":"test","section":"Tests","hidden":false},{"type":"ci","section":"CI/CD","hidden":false},{"type":"refactor","section":"Maintenance","hidden":false},{"type":"perf","section":"Maintenance","hidden":false},{"type":"revert","section":"Maintenance","hidden":false},{"type":"docs","section":"Documentation","hidden":false},{"type":"security","section":"Security","hidden":false}]'
17 changes: 14 additions & 3 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,34 @@ 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: |
poetry run isort --check-only .
- name: Check with black
run: |
poetry run black --check ./src/autoembedder ./tests
poetry run black --check ./src/autoembedder
- name: Check with mypy
run: |
poetry run mypy --config-file=pyproject.toml .
- name: Lint with pylint
run: |
poetry run pylint --rcfile=pyproject.toml ./src/autoembedder ./tests
poetry run pylint --rcfile=pyproject.toml ./src/autoembedder
17 changes: 15 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
default_language_version:
python: python3.10

repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.1.1
Expand All @@ -17,10 +20,12 @@ repos:
"test",
"security",
"perf",
"resolve",
"merge",
]

- 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
Expand Down Expand Up @@ -67,8 +72,16 @@ repos:
- "--config-file=pyproject.toml"
exclude: "tests"

- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
exclude: "^tests/"
args:
- "-r"

- repo: https://github.com/python-poetry/poetry
rev: 1.3.1
rev: 1.3.0
hooks:
- id: poetry-check
- id: poetry-lock
Expand Down
Loading

0 comments on commit c1bf46f

Please sign in to comment.