From b15e8e8f88eb08d3eb6cdbcfbaa18b8d73614345 Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Sat, 10 Jun 2023 19:20:43 +0200 Subject: [PATCH] Preserve env variables for sudo calls --- .github/workflows/linux.yml | 7 +++---- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7d1916e..960ae87 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -15,12 +15,11 @@ jobs: run: | sudo apt-get install inotify-tools acl - name: Execute tests and generate coverage report - env: | - RUNNING_ON_GITHUB_ACTIONS=true - SSH_PORT=22 run: | + export RUNNING_ON_GITHUB_ACTIONS=true + export SSH_PORT=22 echo "Running on github actions: ${RUNNING_ON_GITHUB_ACTIONS}" echo "Running on ssh port ${SSH_PORT}" - sudo bash ./dev/tests/run_tests.sh + sudo -E bash ./dev/tests/run_tests.sh - name: Upload Coverage to Codecov uses: codecov/codecov-action@v1 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2c5e52e..a22c7f5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -23,6 +23,6 @@ jobs: run: | export RUNNING_ON_GITHUB_ACTIONS=true export SSH_PORT=22 - sudo bash ./dev/tests/run_tests.sh + sudo -E bash ./dev/tests/run_tests.sh - name: Upload Coverage to Codecov uses: codecov/codecov-action@v1 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d59e08d..61521ef 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -20,9 +20,9 @@ jobs: - name: Execute tests and generate coverage report shell: wsl-bash {0} run: | - export RUNNING_ON_GITHUB_ACTIONS=true - export SSH_PORT=22 - find . -type f -not -path ".git/*" -print0 | xargs -0 -n 1 -P 4 dos2unix + export RUNNING_ON_GITHUB_ACTIONS=true + export SSH_PORT=22 + find ./ -type f ! -path "./.git/*" -print0 | xargs -0 -n 1 -P 4 dos2unix service ssh start ./dev/tests/run_tests.sh - name: Upload Coverage to Codecov