@@ -0,0 +1,42 @@
|
|||||||
|
name: test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ["*"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# repo
|
||||||
|
- name: Check out repository
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
# python
|
||||||
|
- name: Set up python
|
||||||
|
id: setup-python
|
||||||
|
uses: actions/setup-python@v7
|
||||||
|
with:
|
||||||
|
python-version: "3.14"
|
||||||
|
cache: "pip"
|
||||||
|
# project-manager
|
||||||
|
- name: Install Project Manager
|
||||||
|
run: |
|
||||||
|
pip install project-manager \
|
||||||
|
--index-url https://git.shmyga.ru/api/packages/InfernalGames/pypi/simple/ \
|
||||||
|
--extra-index-url https://pypi.org/simple
|
||||||
|
# setup
|
||||||
|
- name: Setup config
|
||||||
|
run: pm setup:config -vv
|
||||||
|
# build
|
||||||
|
- name: Build docker
|
||||||
|
run: pm build:docker -vv
|
||||||
|
# login docker
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
registry: git.shmyga.ru
|
||||||
|
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
# pubish
|
||||||
|
- name: Publish docker
|
||||||
|
run: pm publish:docker -vv
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
name: test
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
#- name: Install poetry
|
||||||
|
# run: pipx install poetry
|
||||||
|
- name: Install Packages
|
||||||
|
uses: threeal/pipx-install-action@v2.0.0
|
||||||
|
with:
|
||||||
|
packages: poetry
|
||||||
|
- uses: actions/setup-python@v7
|
||||||
|
with:
|
||||||
|
python-version: "3.14"
|
||||||
|
cache: "poetry"
|
||||||
|
- run: poetry install
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
source .venv/bin/activate
|
||||||
|
coverage run -m pytest tests/
|
||||||
|
coverage report
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
name: test
|
|
||||||
|
|
||||||
on: push
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
#----------------------------------------------
|
|
||||||
# check-out repo and set-up python
|
|
||||||
#----------------------------------------------
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v7
|
|
||||||
- name: Set up python
|
|
||||||
id: setup-python
|
|
||||||
uses: actions/setup-python@v7
|
|
||||||
with:
|
|
||||||
python-version: "3.14"
|
|
||||||
#----------------------------------------------
|
|
||||||
# install & configure poetry
|
|
||||||
#----------------------------------------------
|
|
||||||
- name: Load cached Poetry installation
|
|
||||||
id: cached-poetry
|
|
||||||
uses: actions/cache@v5
|
|
||||||
with:
|
|
||||||
path: ~/.local # the path depends on the OS
|
|
||||||
key: poetry-1 # increment to reset cache
|
|
||||||
- name: Install Poetry
|
|
||||||
if: steps.cached-poetry.outputs.cache-hit != 'true'
|
|
||||||
uses: snok/install-poetry@v1
|
|
||||||
with:
|
|
||||||
virtualenvs-create: true
|
|
||||||
virtualenvs-in-project: true
|
|
||||||
virtualenvs-path: .venv
|
|
||||||
installer-parallel: true
|
|
||||||
#----------------------------------------------
|
|
||||||
# load cached venv if cache exists
|
|
||||||
#----------------------------------------------
|
|
||||||
- name: Load cached venv
|
|
||||||
id: cached-poetry-dependencies
|
|
||||||
uses: actions/cache@v5
|
|
||||||
with:
|
|
||||||
path: .venv
|
|
||||||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
|
||||||
#----------------------------------------------
|
|
||||||
# install dependencies if cache does not exist
|
|
||||||
#----------------------------------------------
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
|
||||||
run: ~/.local/bin/poetry install --no-interaction --no-root
|
|
||||||
#----------------------------------------------
|
|
||||||
# install your root project, if required
|
|
||||||
#----------------------------------------------
|
|
||||||
- name: Install project
|
|
||||||
run: ~/.local/bin/poetry install --no-interaction
|
|
||||||
#----------------------------------------------
|
|
||||||
# run test suite
|
|
||||||
#----------------------------------------------
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
source .venv/bin/activate
|
|
||||||
coverage run -m pytest tests/
|
|
||||||
coverage report
|
|
||||||
+2
-1
@@ -39,6 +39,7 @@ COPY --from=builder /app ./
|
|||||||
COPY --from=node-builder /app/dist ./static/dist
|
COPY --from=node-builder /app/dist ./static/dist
|
||||||
|
|
||||||
COPY gallery gallery/
|
COPY gallery gallery/
|
||||||
COPY --from=builder --parents locales/**/*.mo ./
|
# COPY --from=builder --parents locales/**/*.mo ./
|
||||||
|
COPY --from=builder /app/locales ./locales
|
||||||
|
|
||||||
CMD ["uvicorn", "gallery.main:app", "--host", "0.0.0.0", "--port", "80", "--log-config", "gallery/logging.yaml"]
|
CMD ["uvicorn", "gallery.main:app", "--host", "0.0.0.0", "--port", "80", "--log-config", "gallery/logging.yaml"]
|
||||||
|
|||||||
Reference in New Issue
Block a user