1313 run-install-script :
1414 runs-on : pvenode
1515 steps :
16- - name : Checkout PR branch (supports forks)
16+ - name : Checkout PR branch
1717 uses : actions/checkout@v4
1818 with :
1919 ref : ${{ github.event.pull_request.head.ref }}
3737 echo "Changed files: $CHANGED_FILES"
3838 echo "SCRIPT=$CHANGED_FILES" >> $GITHUB_ENV
3939 env :
40- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41+
4142
4243 - name : Get scripts
4344 id : check-install-script
@@ -68,11 +69,11 @@ jobs:
6869 echo "Running Test for: $STRIPPED_NAME"
6970 if [[ $FILE =~ ^install/.*-install\.sh$ ]]; then
7071 CT_SCRIPT="ct/$STRIPPED_NAME.sh"
72+ echo $CT_SCRIPT
7173 if [[ ! -f $CT_SCRIPT ]]; then
7274 echo "No CT script found for $STRIPPED_NAME"
7375 ERROR_MSG="No CT script found for $FILE"
74- echo "$ERROR_MSG" > result_$STRIPPED_NAME.log
75- continue
76+ RUN=false
7677 fi
7778 echo "Found CT script for $STRIPPED_NAME"
7879 chmod +x "$CT_SCRIPT"
@@ -82,32 +83,19 @@ jobs:
8283 if [[ ! -f $INSTALL_SCRIPT ]]; then
8384 echo "No install script found for $STRIPPED_NAME"
8485 ERROR_MSG="No install script found for $FILE"
85- echo "$ERROR_MSG" > result_$STRIPPED_NAME.log
86- continue
86+ RUN=false
8787 fi
8888 echo "Found install script for $STRIPPED_NAME"
8989 chmod +x "$INSTALL_SCRIPT"
9090 RUNNING_FILE=$FILE
9191 fi
92- git remote add community-scripts https://github.com/community-scripts/ProxmoxVE.git
93- git fetch community-scripts
94- rm -f .github/workflows/scripts/app-test/pr-build.func || true
95- rm -f .github/workflows/scripts/app-test/pr-install.func || true
96- rm -f .github/workflows/scripts/app-test/pr-alpine-install.func || true
97- rm -f .github/workflows/scripts/app-test/pr-create-lxc.sh || true
98- git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-build.func
99- git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-install.func
100- git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-alpine-install.func
101- git checkout community-scripts/main -- .github/workflows/scripts/app-test/pr-create-lxc.sh
102- chmod +x $RUNNING_FILE
103- chmod +x .github/workflows/scripts/app-test/pr-create-lxc.sh
104- chmod +x .github/workflows/scripts/app-test/pr-install.func
105- chmod +x .github/workflows/scripts/app-test/pr-alpine-install.func
106- chmod +x .github/workflows/scripts/app-test/pr-build.func
107- sed -i 's|source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)|source .github/workflows/scripts/app-test/pr-build.func|g' "$RUNNING_FILE"
108- echo "Executing $RUNNING_FILE"
109- ERROR_MSG=$(./$RUNNING_FILE 2>&1 > /dev/null)
110- echo "Finished running $FILE"
92+ if [[ $RUN != "false" ]]; then
93+ chmod +x $RUNNING_FILE
94+ sed -i 's|source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)|source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/.github/workflows/scripts/app-test/pr-build.func)|g' "$RUNNING_FILE"
95+ echo "Executing $RUNNING_FILE"
96+ ERROR_MSG=$(./$RUNNING_FILE 2>&1 > /dev/null)
97+ echo "Finished running $FILE"
98+ fi
11199 if [ -n "$ERROR_MSG" ]; then
112100 echo "ERROR in $STRIPPED_NAME: $ERROR_MSG"
113101 echo "$ERROR_MSG" > result_$STRIPPED_NAME.log
@@ -125,12 +113,13 @@ jobs:
125113 pct stop $container_id
126114 pct destroy $container_id
127115 fi
128- done
116+ done
117+
129118
130119 - name : Post error comments
131120 run : |
132121 ERROR="false"
133- SEARCH_LINE=".github/workflows/scripts/app-test/pr-build.func: line 253: "
122+ SEARCH_LINE=".github/workflows/scripts/app-test/pr-build.func: line 255 "
134123 for FILE in ${{ env.ALL_FILES }}; do
135124 STRIPPED_NAME=$(basename "$FILE" | sed 's/-install//' | sed 's/\.sh$//')
136125 if [[ ! -f result_$STRIPPED_NAME.log ]]; then
@@ -145,8 +134,6 @@ jobs:
145134 gh pr comment ${{ github.event.pull_request.number }} \
146135 --repo ${{ github.repository }} \
147136 --body ":warning : The script _**$FILE**_ failed with the following message: <br> <div><strong>${CLEANED_ERROR_MSG}</strong></div>"
148-
149-
150137 ERROR="true"
151138 fi
152139 done
@@ -157,3 +144,5 @@ jobs:
157144 - name : Fail if error
158145 if : ${{ env.ERROR == 'true' }}
159146 run : exit 1
147+
148+
0 commit comments