From 565d4acdd7a66fd479da1d11b61b95d726bf7407 Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Wed, 13 Nov 2024 16:09:06 +0800 Subject: [PATCH] ci: verify extra in the real docker build environment --- .github/workflows/verify_extra.yml | 54 ++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/.github/workflows/verify_extra.yml b/.github/workflows/verify_extra.yml index 902c86e..c5a80d4 100644 --- a/.github/workflows/verify_extra.yml +++ b/.github/workflows/verify_extra.yml @@ -8,10 +8,12 @@ on: jobs: verify: + name: Verify python:${{ matrix.python }}${{ matrix.slim == 'true' && '-slim' || '' }} runs-on: ubuntu-latest strategy: matrix: python: ['3.11', '3.12', '3.13'] # last 3 minor versions + slim: ['true', 'false'] steps: - uses: actions/checkout@v4 @@ -19,10 +21,14 @@ jobs: with: python-version: '${{ matrix.python }}' - - name: Verify Installability + - name: Prepare requirements and Dockerfile run: | - python3 -m pip install -U pip + set -eux + mkdir extra_check + cp src/requirements_extra.txt extra_check/requirements_extra.txt + cd extra_check + python3 -m pip install -U pip output=$(pip3 install --dry-run --no-deps -I --report - --quiet mcdreforged 2>/dev/null) mcdr_version=$(echo -E "$output" | jq '.install[0].metadata.version' -r) if [ -z $mcdr_version ]; then @@ -31,11 +37,45 @@ jobs: exit 1 fi echo "Latest MCDR version: $mcdr_version" - echo "mcdreforged==$mcdr_version" >> src/requirements_extra.txt - - pip3 install -r src/requirements_extra.txt + echo "mcdreforged==$mcdr_version" >> ./requirements_extra.txt + cat ./requirements_extra.txt - echo "# Installation Summary (python ${{matrix.python}})" >> $GITHUB_STEP_SUMMARY + cat < Dockerfile + FROM python:${{ matrix.python }}${{ matrix.slim == 'true' && '-slim' || '' }} + COPY ./requirements_extra.txt / + RUN < /github_workspace/freeze_out.txt + + - name: Report + run: | + echo "# Installation Summary (python ${{ matrix.python }}, slime ${{ matrix.slim }})" >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - pip3 freeze >> $GITHUB_STEP_SUMMARY + cat ./freeze_out.txt >> $GITHUB_STEP_SUMMARY echo "\`\`\`" >> $GITHUB_STEP_SUMMARY