Update GitHub Actions workflow for Python setup #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test pip root user warning repro | |
| on: | |
| push: | |
| jobs: | |
| repro: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ubuntu:24.04 | |
| options: --user root | |
| steps: | |
| - name: Ensure Sudo is Installed | |
| run: | | |
| if ! command -v sudo &> /dev/null; then | |
| echo "sudo could not be found. Installing..." | |
| apt-get update && apt-get install -y sudo | |
| fi | |
| - name: Install prerequisites | |
| run: | | |
| apt-get update | |
| apt-get install -y curl ca-certificates git | |
| - name: Check user | |
| run: | | |
| whoami | |
| id -u | |
| - name: Check ownership | |
| run: ls -ld /github/home | |
| # - name: Give all permissions to the current user | |
| # run: sudo chmod -R 777 /github/home | |
| - name: Change ownership of /github/home | |
| run: sudo chown -R $(whoami) /github/home | |
| - name: Check ownership | |
| run: ls -ld /github/home | |
| - name: Set up Python | |
| # uses: actions/setup-python@v6 | |
| # uses: lmvysakh/setup-python@rootuser_warning_fix | |
| uses: priyagupta108/setup-python@pip-root-user-warning | |
| with: | |
| python-version: '3.13.7' | |
| - name: Show pip version | |
| run: python -m pip --version |