From bf6b908102b3e6db8b2d033e64013d46c6e0bb62 Mon Sep 17 00:00:00 2001 From: Thephaseless Date: Sun, 27 Oct 2024 18:46:19 +0000 Subject: [PATCH] separated github dependent websites --- .github/workflows/docker-publish.yml | 1 + Dockerfile | 3 +++ tests/main_test.py | 17 ++++++++++++----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6b17706..5951cea 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -93,6 +93,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + build-args: GITHUB_BUILD=true - name: Upload error logs if: ${{ failure() }} diff --git a/Dockerfile b/Dockerfile index d3e20d9..0a676d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,9 @@ FROM python:3.12-alpine # Inspired by https://github.com/Hudrolax/uc-docker-alpine/ +ARG GITHUB_BUILD=false +ENV GITHUB_BUILD=${GITHUB_BUILD} + # Install build dependencies RUN apk update && apk upgrade && \ apk add --no-cache --virtual .build-deps \ diff --git a/tests/main_test.py b/tests/main_test.py index 283b3be..45de88c 100644 --- a/tests/main_test.py +++ b/tests/main_test.py @@ -1,3 +1,4 @@ +import os from http import HTTPStatus from time import sleep @@ -14,13 +15,19 @@ client = TestClient(app) test_websites = [ "https://btmet.com/", "https://ext.to/", - # Not testable on github actions - # "https://www.ygg.re/", - # "https://extratorrent.st/", - # "https://idope.se/", - # "https://speed.cd/login", ] +# Not testable on github actions +github_restricted = [ + "https://www.ygg.re/", + "https://extratorrent.st/", + "https://idope.se/", + "https://speed.cd/login", +] + +if os.getenv("GITHUB_ACTIONS") == "true": + test_websites.extend(github_restricted) + @pytest.mark.parametrize("website", test_websites) def test_bypass(website: str):