Actually merge pytest.yml and build.yml

This commit is contained in:
2022-09-26 02:27:35 +02:00
parent aba52ab944
commit e9e5d6bb2a
2 changed files with 16 additions and 42 deletions

View File

@ -1,26 +1,28 @@
---
name: Docker
on:
schedule:
- cron: "20 6 * * *"
workflow_run:
workflows: [ "pytest" ]
types:
- completed
workflow_dispatch:
name: Test code, build Docker image, and push to Docker Hub and GitHub Container Registry.
on: [ push, pull_request, workflow_dispatch ]
env:
SERVE_DOMAIN: https://localhost/
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
UPLOAD_FOLDER: ./Uploads
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
test:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v3
- run: pipx install poetry
- uses: FedericoCarboni/setup-ffmpeg@v1
id: setup-ffmpeg
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'poetry'
- run: poetry install
- run: poetry run pytest
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2

View File

@ -1,28 +0,0 @@
---
name: pytest
on: [ push, pull_request, workflow_dispatch ]
env:
SERVE_DOMAIN: https://localhost/
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
UPLOAD_FOLDER: ./Uploads
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10" ]
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- run: pipx install poetry
- name: Install ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v1
id: setup-ffmpeg
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- run: poetry install
- run: poetry run pytest