mirror of
https://github.com/jaypyles/Scraperr.git
synced 2026-05-03 07:50:41 +00:00
58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
name: Unit Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
unit-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set env
|
|
run: echo "ENV=test" >> $GITHUB_ENV
|
|
|
|
- name: Install pdm
|
|
run: pip install pdm
|
|
|
|
- name: Install project dependencies
|
|
run: pdm install
|
|
|
|
- name: Install playwright
|
|
run: pdm run playwright install
|
|
|
|
- name: Run tests
|
|
run: PYTHONPATH=. pdm run pytest api/backend/tests
|
|
|
|
cypress-tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: ./.github/actions/run-cypress-tests
|
|
|
|
success-message:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- unit-tests
|
|
- cypress-tests
|
|
steps:
|
|
- name: Send Discord Message
|
|
uses: jaypyles/discord-webhook-action@v1.0.0
|
|
with:
|
|
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
|
content: "Scraperr Successfully Passed Tests"
|
|
username: "Scraperr CI"
|
|
embed-title: "✅ Deployment Status"
|
|
embed-description: "Scraperr successfully passed all tests."
|
|
embed-color: 3066993 # Green
|
|
embed-footer-text: "Scraperr CI"
|
|
embed-timestamp: ${{ github.event.head_commit.timestamp }}
|