diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index ce011a2da2..2339c71a92 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -5,6 +5,11 @@ inputs: TARGET: required: true + SUDO: + description: 'Set to "sudo" to run the build with sudo, or leave undefined to run as the current user' + 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..675ee7592d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,6 +84,7 @@ jobs: - name: build uses: ./.github/actions/build with: + SUDO: "" TARGET: '${{ matrix.target }}' TOOL: cross RUSTFLAGS: --cfg qemu -D warnings @@ -92,6 +93,7 @@ jobs: uses: ./.github/actions/test with: TARGET: '${{ matrix.target }}' + SUDO: "" TOOL: cross RUSTFLAGS: --cfg qemu -D warnings