8
8
9
9
jobs :
10
10
verify :
11
+ name : Verify python:${{ matrix.python }}${{ matrix.slim == 'true' && '-slim' || '' }}
11
12
runs-on : ubuntu-latest
12
13
strategy :
13
14
matrix :
14
15
python : ['3.11', '3.12', '3.13'] # last 3 minor versions
16
+ slim : ['true', 'false']
15
17
16
18
steps :
17
19
- uses : actions/checkout@v4
18
20
- uses : actions/setup-python@v5
19
21
with :
20
22
python-version : ' ${{ matrix.python }}'
21
23
22
- - name : Verify Installability
24
+ - name : Prepare requirements and Dockerfile
23
25
run : |
24
- python3 -m pip install -U pip
26
+ set -eux
27
+ mkdir extra_check
28
+ cp src/requirements_extra.txt extra_check/requirements_extra.txt
29
+ cd extra_check
25
30
31
+ python3 -m pip install -U pip
26
32
output=$(pip3 install --dry-run --no-deps -I --report - --quiet mcdreforged 2>/dev/null)
27
33
mcdr_version=$(echo -E "$output" | jq '.install[0].metadata.version' -r)
28
34
if [ -z $mcdr_version ]; then
@@ -31,11 +37,45 @@ jobs:
31
37
exit 1
32
38
fi
33
39
echo "Latest MCDR version: $mcdr_version"
34
- echo "mcdreforged==$mcdr_version" >> src/requirements_extra.txt
35
-
36
- pip3 install -r src/requirements_extra.txt
40
+ echo "mcdreforged==$mcdr_version" >> ./requirements_extra.txt
41
+ cat ./requirements_extra.txt
37
42
38
- echo "# Installation Summary (python ${{matrix.python}})" >> $GITHUB_STEP_SUMMARY
43
+ cat <<EOF > Dockerfile
44
+ FROM python:${{ matrix.python }}${{ matrix.slim == 'true' && '-slim' || '' }}
45
+ COPY ./requirements_extra.txt /
46
+ RUN <<EOT
47
+ set -eux
48
+ export PIP_ROOT_USER_ACTION=ignore
49
+ python3 -m pip install -U pip
50
+ pip3 install -r /requirements_extra.txt
51
+ pip3 cache purge && rm -rf ~/.cache/
52
+ EOT
53
+ EOF
54
+ cat Dockerfile
55
+
56
+ - name : Set up Docker Buildx
57
+ uses : docker/setup-buildx-action@v3
58
+ - name : Build check
59
+ id : build
60
+ uses : docker/build-push-action@v5
61
+ with :
62
+ platforms : linux/amd64
63
+ file : extra_check/Dockerfile
64
+ context : extra_check
65
+ push : false
66
+ load : true
67
+ tags : ci-extra-verification:latest
68
+
69
+ - name : pip freeze
70
+ uses : addnab/docker-run-action@v3
71
+ with :
72
+ image : ci-extra-verification:latest
73
+ options : -v ./freeze_out:/freeze_out
74
+ run : pip3 freeze > /freeze_out/freeze.txt
75
+
76
+ - name : Report
77
+ run : |
78
+ echo "# Installation Summary (python ${{ matrix.python }}, slime ${{ matrix.slim }})" >> $GITHUB_STEP_SUMMARY
39
79
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
40
- pip3 freeze >> $GITHUB_STEP_SUMMARY
80
+ cat ./freeze_out/ freeze.txt >> $GITHUB_STEP_SUMMARY
41
81
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
0 commit comments