diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index ce011a2da2..e4b7ea455f 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -5,6 +5,11 @@ inputs: TARGET: required: true + SUDO: + description: 'Set it to an empty string to run the tests as the current user, leave it with the default value to test with "sudo"' + required: false + default: sudo --preserve-env=HOME + TOOL: description: 'Tool used to involve the test command, can be cargo or cross' required: false @@ -24,4 +29,4 @@ runs: - name: test shell: bash - run: ${{ inputs.TOOL }} test --target ${{ inputs.TARGET }} --all-features + run: ${{ inputs.SUDO }} $(which ${{ inputs.TOOL }}) test --target ${{ inputs.TARGET }} --all-features diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b84767897..9b592ad1c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,7 @@ jobs: uses: ./.github/actions/test with: TARGET: '${{ matrix.target }}' + SUDO: "" TOOL: cross RUSTFLAGS: --cfg qemu -D warnings