From 8305c07ba0f434ddaa86a349c90bbd6f44f2900c 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 | 58 ++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/.github/workflows/verify_extra.yml b/.github/workflows/verify_extra.yml index 902c86e..fd3804a 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,49 @@ 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 <> $OUTPUT_FILE + pip3 -V >> $OUTPUT_FILE + pip3 freeze >> $OUTPUT_FILE + + - 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