Serverlibrary CI / test-serverlibrary (push) Successful in 11s
Serverlibrary CI / lint-serverlibrary (push) Successful in 8s
Torrent API CI / test (push) Successful in 12s
Torrent API CI / lint (push) Successful in 8s
Wallpaper Changer CI / test-wallpaper-changer (push) Successful in 20s
Wallpaper Changer CI / lint-wallpaper-changer (push) Successful in 7s
Torrent API CI / build (push) Successful in 30s
Torrent API CI / install (mediahost) (push) Successful in 3s
Torrent API CI / install (vivohost) (push) Successful in 4s
Torrent API CI / install (quiethost) (push) Successful in 5s
Torrent API CI / install (serverhost) (push) Successful in 2s
Wallpaper Changer CI / build (push) Successful in 47s
Wallpaper Changer CI / install (vivohost) (push) Successful in 4s
Wallpaper Changer CI / install (mediahost) (push) Successful in 2s
Wallpaper Changer CI / install (quiethost) (push) Successful in 3s
Wallpaper Changer CI / install (serverhost) (push) Successful in 6s
109 lines
2.9 KiB
YAML
109 lines
2.9 KiB
YAML
name: Torrent API CI
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
- main
|
|
paths:
|
|
- "torrent_api/**"
|
|
- "serverlibrary/**"
|
|
- ".gitea/workflows/torrent_api.yaml"
|
|
pull_request:
|
|
branches:
|
|
- dev
|
|
paths:
|
|
- "torrent_api/**"
|
|
- "serverlibrary/**"
|
|
- ".gitea/workflows/torrent_api.yaml"
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: nikolaik/python-nodejs:python3.12-nodejs20
|
|
steps:
|
|
- name: Check out the tested commit
|
|
uses: actions/checkout@v4
|
|
- name: Install torrent-api
|
|
working-directory: torrent_api
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install ../serverlibrary .
|
|
- name: Run tests
|
|
working-directory: torrent_api
|
|
run: python run_tests.py
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: nikolaik/python-nodejs:python3.12-nodejs20
|
|
|
|
steps:
|
|
- name: Check out the tested commit
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Ruff
|
|
run: python -m pip install ruff
|
|
|
|
- name: Lint torrent_api
|
|
run: ruff check torrent_api/src torrent_api/tests torrent_api/main.py
|
|
|
|
build:
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
needs: [test, lint]
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: nikolaik/python-nodejs:python3.12-nodejs20
|
|
steps:
|
|
- name: Check out the tested commit
|
|
uses: actions/checkout@v4
|
|
- name: Install build dependencies
|
|
working-directory: torrent_api
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install ../serverlibrary .
|
|
python -m pip install pyinstaller
|
|
|
|
- name: Build one-file executable
|
|
working-directory: torrent_api
|
|
run: python -m PyInstaller --noconfirm torrent_api.spec
|
|
- name: Verify executable
|
|
working-directory: torrent_api
|
|
run: |
|
|
test -x dist/torrent_api
|
|
dist/torrent_api --help
|
|
- name: Upload executable
|
|
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
|
|
with:
|
|
name: torrent-api-build
|
|
path: torrent_api/dist/torrent_api
|
|
if-no-files-found: error
|
|
|
|
install:
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
needs: build
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
runner:
|
|
- vivohost
|
|
- quiethost
|
|
- serverhost
|
|
- mediahost
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- name: Download executable
|
|
uses: https://github.com/christopherHX/gitea-download-artifact@v4
|
|
with:
|
|
name: torrent-api-build
|
|
path: dist/
|
|
- name: Install torrent_api
|
|
run: |
|
|
set -euo pipefail
|
|
install -d -m 755 "$HOME/tools"
|
|
install -m 755 dist/torrent_api "$HOME/tools/torrent_api"
|