Skip to content

Commit

Permalink
chore: redo CI to be more automated
Browse files Browse the repository at this point in the history
  • Loading branch information
marksie1988 committed May 31, 2024
1 parent 94ec8c7 commit 7a1a605
Show file tree
Hide file tree
Showing 34 changed files with 366 additions and 264 deletions.
10 changes: 4 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ RUN apt update && apt upgrade -y
RUN apt install -y zsh python3-sphinx

# Poetry
ARG POETRY_VERSION="latest"
RUN if [ "$POETRY_VERSION" = "latest" ]; then su vscode -c "umask 0002 && sudo pip3 install poetry"; fi
RUN if [ "$POETRY_VERSION" != "none" && "$POETRY_VERSION" != "latest" ]; then su vscode -c "umask 0002 && sudo pip3 install poetry==$POETRY_VERSION"; fi
RUN su vscode -c "umask 0002 && sudo pip3 install poetry"

# Nox
ARG NOX_VERSION="latest"
RUN if [ "$NOX_VERSION" = "latest" ]; then su vscode -c "umask 0002 && sudo pip3 install nox-poetry nox"; fi
RUN if [ "$NOX_VERSION" != "none" && "$POETRY_VERSION" != "latest" ]; then su vscode -c "umask 0002 && sudo pip3 install nox-poetry nox==$NOX_VERSION"; fi
RUN su vscode -c "umask 0002 && sudo pip3 install nox-poetry nox"

RUN wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O - | zsh || true

RUN poetry congfig virtualenvs.in-project true

CMD ["zsh"]
69 changes: 69 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"name": "PyArr",
"dockerComposeFile": [
"docker-compose.workspace.yml"
],
"service": "pyarr-workspace",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"forwardPorts": [
"sonarr:8989",
"radarr:7878",
"readarr:8787",
"lidarr:8686"
],
"initializeCommand": "echo 'Hello World!'",
"customizations": {
"vscode": {
"settings": {
"[python]": {
"diffEditor.ignoreTrimWhitespace": false,
"editor.formatOnType": true,
"editor.wordBasedSuggestions": "off",
"editor.defaultFormatter": "ms-python.black-formatter",
"autoDocstring.docstringFormat": "google",
"editor.tabSize": 4
},
"[yaml]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.autoIndent": "advanced",
"diffEditor.ignoreTrimWhitespace": false
},
"files.eol": "\n",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true
},
"extensions": [
"sourcery.sourcery",
"njpwerner.autodocstring",
"ms-python.flake8",
"dbaeumer.vscode-eslint",
"ms-python.isort",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"GitHub.vscode-github-actions",
"yzhang.markdown-all-in-one"
],
"runArgs": [
"--network=pyarr-dev"
]
}
},
"remoteUser": "vscode",
"postCreateCommand": "zsh ./.devcontainer/post-install.sh",
"mounts": [
/* Re-use local SSH keys (useful if you use SSH keys for Git repo access or other SSH work)*/
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
/* Re-use local Git configuration*/
"source=${localEnv:HOME}/.gitconfig,target=/home/vscode/.gitconfig,type=bind,consistency=cached",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,27 @@ services:
ports:
- 8686:8686
restart: unless-stopped
deluge:
image: lscr.io/linuxserver/deluge:latest
container_name: deluge
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- ../tests/docker_configs/deluge/config:/config
ports:
- 8112:8112
restart: unless-stopped
jackett:
image: lscr.io/linuxserver/jackett:latest
container_name: jackett
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- ../tests/docker_configs/jackett/config:/config
ports:
- 9117:9117
restart: unless-stopped
#deluge:
# image: lscr.io/linuxserver/deluge:latest
# container_name: deluge
# environment:
# - PUID=1000
# - PGID=1000
# - TZ=Europe/London
# volumes:
# - ../tests/docker_configs/deluge/config:/config
# ports:
# - 8112:8112
# restart: unless-stopped
#jackett:
# image: lscr.io/linuxserver/jackett:latest
# container_name: jackett
# environment:
# - PUID=1000
# - PGID=1000
# - TZ=Europe/London
# volumes:
# - ../tests/docker_configs/jackett/config:/config
# ports:
# - 9117:9117
# restart: unless-stopped
8 changes: 0 additions & 8 deletions .devcontainer/example-env

This file was deleted.

61 changes: 0 additions & 61 deletions .devcontainer/recommended-devcontainer.json

This file was deleted.

27 changes: 0 additions & 27 deletions .github/release.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/check-version.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: coverage
on:
push:
branches:
- master
- beta
pull_request:
branches:
- master
- beta
workflow_dispatch:

jobs:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Sphinx Documentation Build and Publish

on:
push:
branches:
- main # Adjust branch name as needed
paths:
- "docs/**"

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12 # Adjust Python version as needed

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry nox
pip install -r docs/requirements.txt
- name: Build documentation
run: |
nox -s build_docs
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/
23 changes: 0 additions & 23 deletions .github/workflows/publish-docs.yml

This file was deleted.

Loading

0 comments on commit 7a1a605

Please sign in to comment.