1
0
mirror of https://github.com/ijaric/voice_assistant.git synced 2025-12-14 19:06:17 +00:00

init commit

This commit is contained in:
Artem Litvinov
2023-09-16 10:08:12 +01:00
commit 536a9e4de8
46 changed files with 7379 additions and 0 deletions

12
.github/workflows/assign-pr-author.yaml vendored Normal file
View File

@@ -0,0 +1,12 @@
name: Assign PR Author
on: [pull_request]
jobs:
assign-pr-author:
runs-on: ubuntu-latest
steps:
- uses: samspills/assign-pr-to-author@v1.0
if: github.event_name == 'pull_request' && github.event.action == 'opened'
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

116
.github/workflows/check-pr.yaml vendored Normal file
View File

@@ -0,0 +1,116 @@
name: Check PR
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
generate-matrix:
name: Generate job matrices
runs-on: ubuntu-20.04
outputs:
packages-matrix: ${{ steps.packages-matrix.outputs.matrix }}
steps:
- name: Generate packages matrix
id: packages-matrix
uses: hellofresh/action-changed-files@v2
with:
pattern: src/(?P<package>[^/]+)/
check-root:
name: Check root
runs-on: ubuntu-20.04
permissions:
contents: read
container:
image: ghcr.io/yp-middle-python-24/ubuntu-ci:jammy-0.0.1
credentials:
username: ${{ secrets.ROBOT_GITHUB_USER }}
password: ${{ secrets.ROBOT_GITHUB_READ_PACKAGES_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
make ci-init
- name: Lint PR
run: |
make lint
- name: Test PR
run: |
make test
check-package:
name: Check package
runs-on: ubuntu-20.04
needs: [generate-matrix]
if: ${{ fromJson(needs.generate-matrix.outputs.packages-matrix).include[0] }}
strategy:
matrix:
package: ${{ fromJson(needs.generate-matrix.outputs.packages-matrix).include[*].package }}
fail-fast: false
permissions:
contents: read
container:
image: ghcr.io/yp-middle-python-24/ubuntu-ci:jammy-0.0.1
credentials:
username: ${{ secrets.ROBOT_GITHUB_USER }}
password: ${{ secrets.ROBOT_GITHUB_READ_PACKAGES_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to pypi
working-directory: src/${{ matrix.package }}
env:
PYPI_READER_PASSWORD: ${{ secrets.PYPI_READER_PASSWORD }}
run: |
make ci-login-pypi
- name: Install repository dependencies
run: |
make ci-init
- name: Install package dependencies
working-directory: src/${{ matrix.package }}
run: |
make init
- name: Lint Package
working-directory: src/${{ matrix.package }}
run: |
make lint
- name: Test Package
working-directory: src/${{ matrix.package }}
run: |
make ci-test
results:
if: ${{ always() }}
runs-on: ubuntu-20.04
name: Final Results
needs: [check-package]
steps:
- run: |
result="${{ needs.check-package.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi

93
.github/workflows/publish-changes.yaml vendored Normal file
View File

@@ -0,0 +1,93 @@
name: Publish changed packages
on:
push:
branches:
- master
jobs:
generate-matrix:
name: Generate job matrices
runs-on: ubuntu-20.04
outputs:
packages-matrix: ${{ steps.packages-matrix.outputs.matrix }}
steps:
- name: Generate packages matrix
id: packages-matrix
uses: hellofresh/action-changed-files@v2
with:
pattern: src/(?P<package>[^/]+)/
publish-package:
name: Publish package
runs-on: ubuntu-20.04
needs: [generate-matrix]
if: ${{ fromJson(needs.generate-matrix.outputs.packages-matrix).include[0] }}
strategy:
matrix:
package: ${{ fromJson(needs.generate-matrix.outputs.packages-matrix).include[*].package }}
fail-fast: false
permissions:
contents: read
container:
image: ghcr.io/yp-middle-python-24/ubuntu-ci:jammy-0.0.1
credentials:
username: ${{ secrets.ROBOT_GITHUB_USER }}
password: ${{ secrets.ROBOT_GITHUB_READ_PACKAGES_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check version
id: check_version
working-directory: src/${{ matrix.package }}
run: |
local_version=$(poetry version --short)
remote_version=$( \
curl https://pypi.ovsds.ru/pypi/${{ matrix.package }}/json \
--user "reader:${{ secrets.PYPI_READER_PASSWORD }}" | \
jq -r '.info.version' || \
echo "0.0.0" \
)
echo "local_version=$local_version" >> $GITHUB_OUTPUT
echo "remote_version=$remote_version" >> $GITHUB_OUTPUT
- name: Login to pypi
if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version
working-directory: src/${{ matrix.package }}
env:
PYPI_READER_PASSWORD: ${{ secrets.PYPI_READER_PASSWORD }}
run: |
make ci-login-pypi
- name: Init Package
if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version
working-directory: src/${{ matrix.package }}
run: |
make init
- name: Login to pypi-publish
if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version
working-directory: src/${{ matrix.package }}
env:
PYPI_WRITER_PASSWORD: ${{ secrets.PYPI_WRITER_PASSWORD }}
run: |
make ci-login-pypi-publish
- name: Build Package
if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version
working-directory: src/${{ matrix.package }}
run: |
make ci-package-build
- name: Publish Package
if: steps.check_version.outputs.local_version != steps.check_version.outputs.remote_version
working-directory: src/${{ matrix.package }}
run: |
make ci-package-publish