1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-23 00:03:33 +00:00
bazarr/.github/workflows/ci.yml

106 lines
2.5 KiB
YAML
Raw Normal View History

2021-03-25 14:22:43 +00:00
name: CI
on:
push:
branches: [development]
2021-03-27 16:31:29 +00:00
paths:
- frontend/**
- bazarr/**
- libs/**
2023-08-04 14:27:36 +00:00
- migrations/**
- bazarr.py
- requirements.txt
- dev-requirements.txt
2021-03-27 16:31:29 +00:00
- .github/workflows/ci.yml
2021-03-25 14:22:43 +00:00
pull_request:
branches: [development]
2021-03-27 16:31:29 +00:00
env:
UI_DIRECTORY: ./frontend
UI_ARTIFACT_NAME: ui
2021-03-25 14:22:43 +00:00
jobs:
Frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
2023-11-18 17:10:19 +00:00
uses: actions/checkout@v4
2021-03-25 14:22:43 +00:00
- name: Cache node_modules
uses: actions/cache@v4
with:
path: "${{ env.UI_DIRECTORY }}/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-modules-
- name: Setup NodeJS
uses: actions/setup-node@v4
2021-03-25 14:22:43 +00:00
with:
2024-06-10 01:24:02 +00:00
node-version-file: "${{ env.UI_DIRECTORY }}/.nvmrc"
2021-03-25 14:22:43 +00:00
- name: Install dependencies
run: npm install
working-directory: ${{ env.UI_DIRECTORY }}
2021-03-25 14:22:43 +00:00
- name: Check Types
run: npm run check:ts
working-directory: ${{ env.UI_DIRECTORY }}
- name: Check Styles
run: npm run check
working-directory: ${{ env.UI_DIRECTORY }}
- name: Check Format
run: npm run check:fmt
working-directory: ${{ env.UI_DIRECTORY }}
- name: Unit Test
run: npm test
working-directory: ${{ env.UI_DIRECTORY }}
- name: Build
run: npm run build:ci
working-directory: ${{ env.UI_DIRECTORY }}
2024-03-08 18:41:24 +00:00
- uses: actions/upload-artifact@v4
with:
name: ${{ env.UI_ARTIFACT_NAME }}
path: "${{ env.UI_DIRECTORY }}/build"
Backend:
runs-on: ubuntu-latest
needs: Frontend
steps:
- name: Checkout repository
2023-11-18 17:10:19 +00:00
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install UI
2024-03-08 18:41:24 +00:00
uses: actions/download-artifact@v4
with:
name: ${{ env.UI_ARTIFACT_NAME }}
path: "${{ env.UI_DIRECTORY }}/build"
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Unit Tests
run: |
2023-11-18 17:10:19 +00:00
python3 bazarr.py --no-update &
PID=$!
sleep 15
if kill -s 0 $PID
then
echo "**** Bazarr launch successful ****"
kill $PID
exit 0
else
echo "**** Bazarr launch failed ****"
exit 1
fi