Actually merge pytest.yml and build.yml
This commit is contained in:
@ -1,26 +1,28 @@
|
|||||||
---
|
---
|
||||||
name: Docker
|
name: Test code, build Docker image, and push to Docker Hub and GitHub Container Registry.
|
||||||
on:
|
on: [ push, pull_request, workflow_dispatch ]
|
||||||
schedule:
|
|
||||||
- cron: "20 6 * * *"
|
|
||||||
workflow_run:
|
|
||||||
workflows: [ "pytest" ]
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
SERVE_DOMAIN: https://localhost/
|
||||||
|
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
|
||||||
|
UPLOAD_FOLDER: ./Uploads
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
steps:
|
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
|
- name: Login to Docker Hub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
28
.github/workflows/pytest.yml
vendored
28
.github/workflows/pytest.yml
vendored
@ -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
|
|
Reference in New Issue
Block a user