Skip to content

Commit 432edce

Browse files
avtikhonkyukhin
authored andcommitted
github-ci: set sudo for apt commands
After commit: 58fe0fc ('github-ci: avoid of use container tags in actions') We began to use not the docker containers, but native github hosts. To avoid of permissions fails on native github actions runners apt command must run using sudo. Added flag '-n|--non-interactive' to sudo command to avoid prompting the user for input of any kind which could hang it. Added '-y' flag to apt update command to accept changes.
1 parent 447775f commit 432edce

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.github/actions/environment/action.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ runs:
2121
# run from it. So running it only outside of docker container.
2222
# Also on local hosts, like that we use for 'freebsd' workflow
2323
# testing, 'sudo' not acceptable outside of 'freebsd' virtual
24-
# machine and to avoid of hangs let's check sudo run ability
25-
# with command like 'timeout 2 sudo ls /sbin/swapoff'.
24+
# machine and to avoid of hangs let's run it with '-n' flag.
2625
# NOTE: To switch off swap from inside github 'container' tag
2726
# additional memory flags should be added to its 'options' tag:
2827
# options: '--memory=<some value, like 7G> --memory-swap=<the same value as for memory option>'
2928
if which free ; then
3029
echo "Check initial swap memory values:"
3130
free
3231
fi
33-
if timeout 2 sudo ls /sbin/swapoff ; then
32+
if sudo -n ls /sbin/swapoff ; then
3433
echo "Verified that 'sudo' enabled, switching off swap ..."
3534
sudo /sbin/swapoff -a || echo "'swapoff' command failed, but failure is acceptable from inside the container"
3635
if [ -e /proc/meminfo ] ; then

.github/actions/send-telegram-notify/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ runs:
3030
shell: bash
3131
# get job id number
3232
- run: |
33-
apt update ||:
34-
apt install -y jq ||:
33+
sudo -n apt update -y ||:
34+
sudo -n apt install -y jq ||:
3535
echo 'JOB_ID<<EOF' >> $GITHUB_ENV
3636
curl -s https://api.github.com/repos/tarantool/tarantool/actions/runs/${{ github.run_id }}/jobs | jq -r '.jobs[0].id' | tee -a $GITHUB_ENV
3737
echo 'EOF' >> $GITHUB_ENV

0 commit comments

Comments
 (0)