Skip to content

Commit e9e2821

Browse files
Retry on fail for main test
1 parent db78480 commit e9e2821

File tree

1 file changed

+41
-36
lines changed

1 file changed

+41
-36
lines changed

.github/workflows/test.yml

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -47,42 +47,47 @@ jobs:
4747
sudo npm install -g asar # to get pacakges.json from resources/app.asar for electron-builder applications
4848
# npm install -g @alexlafroscia/yaml-merge # to merge yaml files
4949
- name: Main test
50-
# shell: bash
51-
run: |
52-
# set -e
53-
mkdir $HOME/.icewm/
54-
echo "ShowTaskBar = 0" > $HOME/.icewm/preferences
55-
echo "TaskBarAutoHide = 1" > $HOME/.icewm/preferences
56-
echo "TaskBarShowWorkspaces = 0" > $HOME/.icewm/preferences
57-
echo "TaskBarShowAllWindows = 0" > $HOME/.icewm/preferences
58-
echo "TaskBarShowClock = 0" > $HOME/.icewm/preferences
59-
echo "TaskBarShowMailboxStatus = 0" > $HOME/.icewm/preferences
60-
echo "TaskBarShowCPUStatus = 0" > $HOME/.icewm/preferences
61-
echo "TaskBarShowWindowListMenu = 0" > $HOME/.icewm/preferences
62-
# xpra start :99 # Cannot get screenshots to work
63-
Xvfb :99 -screen 0 800x600x24 >/dev/null 2>&1 & # Need to set bit depth, otherwise get some black screenshots
64-
# until xset -q; do echo "Waiting for X server to start..."; sleep 1; done # We are not immediately using it anyway
65-
# Find out which files in data/ have been changed in the last commit
66-
#set -x # Debug #379
67-
FILES=$(git log -1 -p data/ | grep +++ | cut -d '/' -f 2-| sed -e 's|dev/null||g')
68-
# Finds wrong files in PRs! # FILES=$(git log -1 --name-status --diff-filter=AR --pretty=format: -- data/ | awk '/^A/ || /^R/ {file=$2} END {print file}') # Most recent addition or renaming within the last commit
69-
echo "Last changed files from the FILES variable:"
70-
echo "$FILES" ; if [ -z "$FILES" ] ; then echo "Variable FILES is empty." && exit 1 ; fi
71-
# Work on these files that have been changed in the last commit
72-
if [ -n "$FILES" ]; then
73-
for FILE in $FILES; do
74-
echo "$FILE"
75-
bash -e code/worker.sh $(readlink -f "$FILE") 2>&1 | tee log.txt
76-
EXIT_CODE=${PIPESTATUS[0]} # bashism; get the return code of the leftmost element of the pipe
77-
if [ $EXIT_CODE -ne 0 ]; then
78-
echo "worker.sh exited with a non-zero code: $EXIT_CODE"
79-
exit $EXIT_CODE
80-
fi
81-
done
82-
fi
83-
# xpra stop :99
84-
killall Xvfb
85-
# bundle exec jekyll build # https://help.github.com/en/articles/viewing-jekyll-build-error-messages#configuring-a-third-party-service-to-display-jekyll-build-error-messages
50+
uses: nick-fields/retry@v3
51+
with:
52+
max_attempts: 15
53+
timeout_minutes: 5
54+
retry_wait_seconds: 300 # 5 minutes
55+
warning_on_retry: true
56+
command: |
57+
# set -e
58+
mkdir $HOME/.icewm/
59+
echo "ShowTaskBar = 0" > $HOME/.icewm/preferences
60+
echo "TaskBarAutoHide = 1" > $HOME/.icewm/preferences
61+
echo "TaskBarShowWorkspaces = 0" > $HOME/.icewm/preferences
62+
echo "TaskBarShowAllWindows = 0" > $HOME/.icewm/preferences
63+
echo "TaskBarShowClock = 0" > $HOME/.icewm/preferences
64+
echo "TaskBarShowMailboxStatus = 0" > $HOME/.icewm/preferences
65+
echo "TaskBarShowCPUStatus = 0" > $HOME/.icewm/preferences
66+
echo "TaskBarShowWindowListMenu = 0" > $HOME/.icewm/preferences
67+
# xpra start :99 # Cannot get screenshots to work
68+
Xvfb :99 -screen 0 800x600x24 >/dev/null 2>&1 & # Need to set bit depth, otherwise get some black screenshots
69+
# until xset -q; do echo "Waiting for X server to start..."; sleep 1; done # We are not immediately using it anyway
70+
# Find out which files in data/ have been changed in the last commit
71+
#set -x # Debug #379
72+
FILES=$(git log -1 -p data/ | grep +++ | cut -d '/' -f 2-| sed -e 's|dev/null||g')
73+
# Finds wrong files in PRs! # FILES=$(git log -1 --name-status --diff-filter=AR --pretty=format: -- data/ | awk '/^A/ || /^R/ {file=$2} END {print file}') # Most recent addition or renaming within the last commit
74+
echo "Last changed files from the FILES variable:"
75+
echo "$FILES" ; if [ -z "$FILES" ] ; then echo "Variable FILES is empty." && exit 1 ; fi
76+
# Work on these files that have been changed in the last commit
77+
if [ -n "$FILES" ]; then
78+
for FILE in $FILES; do
79+
echo "$FILE"
80+
bash -e code/worker.sh $(readlink -f "$FILE") 2>&1 | tee log.txt
81+
EXIT_CODE=${PIPESTATUS[0]} # bashism; get the return code of the leftmost element of the pipe
82+
if [ $EXIT_CODE -ne 0 ]; then
83+
echo "worker.sh exited with a non-zero code: $EXIT_CODE"
84+
exit $EXIT_CODE
85+
fi
86+
done
87+
fi
88+
# xpra stop :99
89+
killall Xvfb
90+
# bundle exec jekyll build # https://help.github.com/en/articles/viewing-jekyll-build-error-messages#configuring-a-third-party-service-to-display-jekyll-build-error-messages
8691
- name: Check log
8792
if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'probonopd'
8893
shell: bash

0 commit comments

Comments
 (0)