Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
ci(tests): bootstrap plex server
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Sep 10, 2023
1 parent 66215e8 commit 274cc89
Show file tree
Hide file tree
Showing 7 changed files with 851 additions and 63 deletions.
110 changes: 89 additions & 21 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,8 @@ jobs:
run: |
python ./scripts/build_plist.py
- name: Upload Artifacts
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: Themerr-plex.bundle
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
path: |
${{ github.workspace }}
!**/*.git*
!**/*.pyc
!**/__pycache__
!**/plexhints*
!**/Themerr-plex.bundle/.*
!**/Themerr-plex.bundle/cache.sqlite
!**/Themerr-plex.bundle/DOCKER_README.md
!**/Themerr-plex.bundle/Dockerfile
!**/Themerr-plex.bundle/docs
!**/Themerr-plex.bundle/scripts
!**/Themerr-plex.bundle/tests
- name: Package Release
shell: bash
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
7z \
"-xr!*.git*" \
Expand All @@ -103,6 +82,7 @@ jobs:
"-xr!plexhints*" \
"-xr!Themerr-plex.bundle/.*" \
"-xr!Themerr-plex.bundle/cache.sqlite" \
"-xr!Themerr-plex.bundle/crowdin.yml" \
"-xr!Themerr-plex.bundle/DOCKER_README.md" \
"-xr!Themerr-plex.bundle/Dockerfile" \
"-xr!Themerr-plex.bundle/docs" \
Expand All @@ -113,6 +93,14 @@ jobs:
mkdir artifacts
mv ./Themerr-plex.bundle.zip ./artifacts/
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: Themerr-plex.bundle
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
path: |
${{ github.workspace }}/artifacts
- name: Create Release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: LizardByte/.github/actions/create_release@master
Expand All @@ -121,3 +109,83 @@ jobs:
next_version: ${{ needs.check_changelog.outputs.next_version }}
last_version: ${{ needs.check_changelog.outputs.last_version }}
release_body: ${{ needs.check_changelog.outputs.release_body }}

pytest:
needs: [build]
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: Themerr-plex.bundle

- name: Extract artifacts zip
shell: bash
run: |
# extract zip
7z x Themerr-plex.bundle.zip -o.
# move all files from "Themerr-plex.bundle" to root, with no target directory
cp -rT ./Themerr-plex.bundle .
# remove empty directory
rm -rf Themerr-plex.bundle
# remove zip
rm Themerr-plex.bundle.zip
- name: Debug after extract
shell: bash
run: |
ls -a ./Contents
- name: Set up Python
uses: LizardByte/.github/actions/setup_python2@nightly

- name: Install python dependencies
shell: bash
run: |
python -m pip --no-python-version-warning --disable-pip-version-check install --upgrade \
pip setuptools wheel
python -m pip --no-python-version-warning --disable-pip-version-check install -r requirements-dev.txt
# python -m pip --no-python-version-warning --disable-pip-version-check install -r requirements.txt
- name: Install docker
if: matrix.os == 'macos-latest'
run: |
brew install docker
- name: Bootstrap Plex server
id: boostrap
uses: nick-fields/[email protected]
with:
max_attempts: 3
timeout_minutes: 2
shell: bash
command: |
python \
-u scripts/plex-bootstraptest.py \
--destination plex \
--advertise-ip 127.0.0.1 \
--bootstrap-timeout 540 \
--docker-tag latest \
--without-shows \
--without-music \
--without-photos \
--unclaimed
on_retry_command: |
# remove docker container
docker rm -f $(docker ps --latest)
- name: Test with pytest
shell: bash # our Python 2.7 setup action doesn't support PowerShell
run: |
python -m pytest -v
40 changes: 0 additions & 40 deletions .github/workflows/python-tests.yml

This file was deleted.

2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ flake8==3.9.2;python_version<"3"
m2r2==0.3.2;python_version<"3"
numpydoc==0.9.2;python_version<"3"
git+https://github.com/LizardByte/plexhints.git#egg=plexhints # type hinting library for plex development
plexapi-backport==4.15.1
pytest==4.6.11;python_version<"3"
rstcheck==3.5.0;python_version<"3"
Sphinx==1.8.6;python_version<"3"
sphinx-rtd-theme==1.2.0;python_version<"3"
tqdm==4.64.1;python_version<"3"
Loading

0 comments on commit 274cc89

Please sign in to comment.