Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Kaplun <skaplun@tarantool.org>,
	Sergey Bronnikov <sergeyb@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org,
	Alexander Turenko <alexander.turenko@tarantool.org>
Subject: [Tarantool-patches] [PATCH 1/2] ci: use sudo to install packages if not root
Date: Thu,  1 Oct 2026 04:06:05 +0300	[thread overview]
Message-ID: <8b3a9c3bc1cae8b15954e8925fba9d751a4f051d.1790815412.git.alexander.turenko@tarantool.org> (raw)
In-Reply-To: <cover.1790815412.git.alexander.turenko@tarantool.org>

The setup-linux and setup-debuggers actions call `apt` without `sudo`,
which works on our self-hosted runners: the jobs run there as root. The
next commit moves the ARM64 jobs to GitHub-hosted runners, where the
steps run as the runner's regular user, so we have to call `sudo` there.

If the current user is already `root`, `sudo` is not called: this way we
don't depend on its presence when we don't need it.

Drafted by an LLM, conducted and corrected by the commit author.
---
 .github/actions/setup-debuggers/action.yml | 6 ++++--
 .github/actions/setup-linux/action.yml     | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/.github/actions/setup-debuggers/action.yml b/.github/actions/setup-debuggers/action.yml
index c34d4502..e2ac09db 100644
--- a/.github/actions/setup-debuggers/action.yml
+++ b/.github/actions/setup-debuggers/action.yml
@@ -7,6 +7,8 @@ runs:
       uses: ./.github/actions/setup-linux
     - name: Install dependencies for the tests
       run: |
-        apt -y update
-        apt install -y python3 gdb lldb
+        # GitHub-hosted runners run the steps as a regular user.
+        SUDO=$([ "$(id -u)" = 0 ] || echo sudo)
+        ${SUDO} apt -y update
+        ${SUDO} apt install -y python3 gdb lldb
       shell: bash
diff --git a/.github/actions/setup-linux/action.yml b/.github/actions/setup-linux/action.yml
index f0171b83..8f13940a 100644
--- a/.github/actions/setup-linux/action.yml
+++ b/.github/actions/setup-linux/action.yml
@@ -14,6 +14,8 @@ runs:
       shell: bash
     - name: Install build and test dependencies
       run: |
-        apt -y update
-        apt -y install cmake gcc make ninja-build perl
+        # GitHub-hosted runners run the steps as a regular user.
+        SUDO=$([ "$(id -u)" = 0 ] || echo sudo)
+        ${SUDO} apt -y update
+        ${SUDO} apt -y install cmake gcc make ninja-build perl
       shell: bash
-- 
2.55.0


  reply	other threads:[~2026-10-01  1:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01  1:06 [Tarantool-patches] [PATCH 0/2] Use GitHub-hosted runners for Linux/ARM64 jobs Alexander Turenko via Tarantool-patches
2026-10-01  1:06 ` Alexander Turenko via Tarantool-patches [this message]
2026-10-01  1:06 ` [Tarantool-patches] [PATCH 2/2] ci: run ARM64 jobs on GitHub-hosted runners Alexander Turenko via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b3a9c3bc1cae8b15954e8925fba9d751a4f051d.1790815412.git.alexander.turenko@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/2] ci: use sudo to install packages if not root' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox