From 8dccb7cc5452480604a95dccfaf49d1bbc70fc48 Mon Sep 17 00:00:00 2001 From: Astariul Date: Sat, 8 Feb 2025 12:24:42 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20Github=20action=20to=20aut?= =?UTF-8?q?omatically=20check=20if=20the=20site=20is=20up=20and=20working?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/install_check.yml | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/install_check.yml diff --git a/.github/workflows/install_check.yml b/.github/workflows/install_check.yml new file mode 100644 index 0000000..f50f28e --- /dev/null +++ b/.github/workflows/install_check.yml @@ -0,0 +1,36 @@ +name: Installation test after page deployment + +on: + # Run after a new version is deployed + pages: + types: [deploy] + + # On demand + workflow_dispatch: + +jobs: + post_deploy_test: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-python@v5 + - name: Install public-hello + run: | + python -m pip install --upgrade pip + pip install public-hello --extra-index-url https://astariul.github.io/github-hosted-pypi/ + + # Check if the package and its dependency was installed + pip show public-hello + pip show mydependency + + # The code from the package should be accessible + python -c "from public_hello import hi; assert hi() == 'Hello world from public repository (with a dependency)'" + - name: Install public-hello older version + run: | + python -m pip install --upgrade pip + pip install public-hello==0.1 --extra-index-url https://astariul.github.io/github-hosted-pypi/ + + # Check if the package was installed + pip show public-hello + + # The code from the package should be accessible + python -c "from public_hello import hi; assert hi() == 'Hello world from public repository'"