-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (76 loc) · 2.69 KB
/
verify_extra.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Verify extra packages
on:
push:
paths:
- 'src/requirements_extra.txt'
- '.github/workflows/verify_extra.yml'
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
- uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python }}'
- name: Prepare requirements and Dockerfile
run: |
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
echo "MCDR version not found. pip output:"
echo -E "$output"
exit 1
fi
echo "Latest MCDR version: $mcdr_version"
echo "mcdreforged==$mcdr_version" >> ./requirements_extra.txt
cat ./requirements_extra.txt
cat <<EOF > Dockerfile
FROM python:${{ matrix.python }}${{ matrix.slim == 'true' && '-slim' || '' }}
COPY ./requirements_extra.txt /
RUN <<EOT
set -eux
export PIP_ROOT_USER_ACTION=ignore
python3 -m pip install -U pip
pip3 install -r /requirements_extra.txt
pip3 cache purge && rm -rf ~/.cache/
EOT
EOF
cat Dockerfile
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build check
id: build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
file: extra_check/Dockerfile
context: extra_check
push: false
load: true # required, so the following step can use this image to run
tags: ci-extra-verification:latest
- name: pip freeze
uses: addnab/docker-run-action@v3
with:
image: ci-extra-verification:latest
options: -v ${{ github.workspace }}:/github_workspace
run: |-
OUTPUT_FILE=/github_workspace/freeze_out.txt
python3 -V >> $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
cat ./freeze_out.txt >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY