mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2025-12-23 22:18:19 -05:00
update github workflows
This commit is contained in:
32
.github/workflows/build-push-backend.yml
vendored
32
.github/workflows/build-push-backend.yml
vendored
@@ -15,6 +15,8 @@ on:
|
||||
- 'uv.lock'
|
||||
- '.github/workflows/build-push-backend.yml'
|
||||
- 'tests/**'
|
||||
- 'web/**'
|
||||
|
||||
pull_request:
|
||||
paths:
|
||||
- 'media_manager/**'
|
||||
@@ -25,11 +27,12 @@ on:
|
||||
- 'uv.lock'
|
||||
- '.github/workflows/build-push-backend.yml'
|
||||
- 'tests/**'
|
||||
- 'web/**'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
lint-code:
|
||||
lint-backend:
|
||||
name: Lint Python Code
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -39,8 +42,26 @@ jobs:
|
||||
with:
|
||||
src: "./media_manager"
|
||||
|
||||
lint-frontend:
|
||||
name: Lint Frontend
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: './web/package-lock.json'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: ./web
|
||||
- name: Lint code
|
||||
run: npm run lint
|
||||
working-directory: ./web
|
||||
|
||||
run-tests:
|
||||
needs: lint-code
|
||||
needs: lint-backend
|
||||
name: Run Python Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -57,7 +78,7 @@ jobs:
|
||||
run: uv run pytest tests
|
||||
|
||||
build-and-push:
|
||||
needs: run-tests
|
||||
needs: [run-tests, lint-frontend]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -84,7 +105,7 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/backend
|
||||
images: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/mediamanager
|
||||
tags: |
|
||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') && github.event_name != 'pull_request' }}
|
||||
type=ref,event=tag
|
||||
@@ -116,3 +137,6 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/mediamanager:buildcache
|
||||
cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/mediamanager:buildcache,mode=max
|
||||
|
||||
|
||||
29
.github/workflows/python-lint.yaml
vendored
29
.github/workflows/python-lint.yaml
vendored
@@ -1,29 +0,0 @@
|
||||
name: Ruff
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'media_manager/**'
|
||||
- 'alembic/**'
|
||||
- 'pyproject.toml'
|
||||
- 'uv.lock'
|
||||
- '.github/workflows/python-lint.yaml'
|
||||
- 'tests/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'media_manager/**'
|
||||
- 'alembic/**'
|
||||
- 'pyproject.toml'
|
||||
- 'uv.lock'
|
||||
- '.github/workflows/python-lint.yaml'
|
||||
- 'tests/**'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
ruff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/ruff-action@v3
|
||||
with:
|
||||
src: "./media_manager"
|
||||
@@ -1,21 +0,0 @@
|
||||
name: Ruff Metadata Relay
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'metadata_relay/**'
|
||||
- '.github/workflows/python-lint_metadata_relay.yaml'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'metadata_relay/**'
|
||||
- '.github/workflows/python-lint_metadata_relay.yaml'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
ruff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: astral-sh/ruff-action@v3
|
||||
with:
|
||||
src: "./metadata_relay"
|
||||
31
.github/workflows/python-tests.yml
vendored
31
.github/workflows/python-tests.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: Run Python Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- 'media_manager/**'
|
||||
- 'alembic/**'
|
||||
- 'alembic.ini'
|
||||
- 'pyproject.toml'
|
||||
- 'uv.lock'
|
||||
- '.github/workflows/python-tests.yml'
|
||||
- 'tests/**'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
run-tests:
|
||||
name: Run Python Tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v5
|
||||
|
||||
- name: Install the project
|
||||
run: uv sync --locked --all-extras --dev
|
||||
|
||||
- name: Run tests
|
||||
run: uv run pytest tests
|
||||
31
.github/workflows/web-lint.yml
vendored
31
.github/workflows/web-lint.yml
vendored
@@ -1,31 +0,0 @@
|
||||
name: Lint Frontend
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- 'web/**'
|
||||
- '.github/workflows/web-lint.yml'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'web/**'
|
||||
- '.github/workflows/web-lint.yml'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint Frontend
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
working-directory: ./web
|
||||
- name: Lint code
|
||||
run: npm run lint
|
||||
working-directory: ./web
|
||||
|
||||
Reference in New Issue
Block a user