| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 650eaaf commit de3a950
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,80 +20,69 @@ jobs: | |||
| 20 | 20 | ||
| 21 | 21 | runs-on: windows-latest | |
| 22 | 22 | ||
| 23 | - env: &cygwin-env | ||
| 23 | + env: | ||
| 24 | 24 | CHERE_INVOKING: "1" | |
| 25 | 25 | CYGWIN_NOWINPATH: "1" | |
| 26 | 26 | ||
| 27 | - defaults: &cygwin-defaults | ||
| 27 | + defaults: | ||
| 28 | 28 | run: | |
| 29 | 29 | shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr "{0}" | |
| 30 | 30 | ||
| 31 | 31 | steps: | |
| 32 | - - &force-lf | ||
| 33 | - name: Force LF line endings | ||
| 32 | + - name: Force LF line endings | ||
| 34 | 33 | run: | | |
| 35 | 34 | git config --global core.autocrlf false # Affects the non-Cygwin git. | |
| 36 | 35 | shell: pwsh # Do this outside Cygwin, to affect actions/checkout. | |
| 37 | 36 | ||
| 38 | - - &checkout | ||
| 39 | - uses: actions/checkout@v6 | ||
| 37 | + - uses: actions/checkout@v6 | ||
| 40 | 38 | with: | |
| 41 | 39 | fetch-depth: 0 | |
| 42 | 40 | ||
| 43 | - - &install-cygwin | ||
| 44 | - name: Install Cygwin | ||
| 41 | + - name: Install Cygwin | ||
| 45 | 42 | uses: cygwin/cygwin-install-action@v6 | |
| 46 | 43 | with: | |
| 47 | 44 | packages: git python39 python-pip-wheel python-setuptools-wheel python-wheel-wheel | |
| 48 | 45 | add-to-path: false # No need to change $PATH outside the Cygwin environment. | |
| 49 | 46 | ||
| 50 | - - &verbose-output | ||
| 51 | - name: Arrange for verbose output | ||
| 47 | + - name: Arrange for verbose output | ||
| 52 | 48 | run: | | |
| 53 | 49 | # Arrange for verbose output but without shell environment setup details. | |
| 54 | 50 | echo 'set -x' >~/.bash_profile | |
| 55 | 51 | ||
| 56 | - - &safe-directory | ||
| 57 | - name: Special configuration for Cygwin git | ||
| 52 | + - name: Special configuration for Cygwin git | ||
| 58 | 53 | run: | | |
| 59 | 54 | git config --global --add safe.directory "$(pwd)" | |
| 60 | 55 | git config --global --add safe.directory "$(pwd)/.git" | |
| 61 | 56 | git config --global --add safe.directory "$(pwd)/git/ext/gitdb" | |
| 62 | 57 | git config --global --add safe.directory "$(pwd)/git/ext/gitdb/gitdb/ext/smmap" | |
| 63 | 58 | git config --global core.autocrlf false | |
| 64 | 59 | ||
| 65 | - - &prepare-repo | ||
| 66 | - name: Prepare this repo for tests | ||
| 60 | + - name: Prepare this repo for tests | ||
| 67 | 61 | run: | | |
| 68 | 62 | ./init-tests-after-clone.sh | |
| 69 | 63 | ||
| 70 | - - &git-identity | ||
| 71 | - name: Set git user identity and command aliases for the tests | ||
| 64 | + - name: Set git user identity and command aliases for the tests | ||
| 72 | 65 | run: | | |
| 73 | 66 | git config --global user.email "travis@ci.com" | |
| 74 | 67 | git config --global user.name "Travis Runner" | |
| 75 | 68 | # If we rewrite the user's config by accident, we will mess it up | |
| 76 | 69 | # and cause subsequent tests to fail | |
| 77 | 70 | cat test/fixtures/.gitconfig >> ~/.gitconfig | |
| 78 | 71 | ||
| 79 | - - &setup-venv | ||
| 80 | - name: Set up virtual environment | ||
| 72 | + - name: Set up virtual environment | ||
| 81 | 73 | run: | | |
| 82 | 74 | python3.9 -m venv .venv | |
| 83 | 75 | echo 'BASH_ENV=.venv/bin/activate' >>"$GITHUB_ENV" | |
| 84 | 76 | ||
| 85 | - - &update-pypa | ||
| 86 | - name: Update PyPA packages | ||
| 77 | + - name: Update PyPA packages | ||
| 87 | 78 | run: | | |
| 88 | 79 | python -m pip install -U pip 'setuptools; python_version<"3.12"' wheel | |
| 89 | 80 | ||
| 90 | - - &install-deps | ||
| 91 | - name: Install project and test dependencies | ||
| 81 | + - name: Install project and test dependencies | ||
| 92 | 82 | run: | | |
| 93 | 83 | pip install '.[test]' | |
| 94 | 84 | ||
| 95 | - - &ownership-posix-display | ||
| 96 | - name: Show POSIX file ownership | ||
| 85 | + - name: Show POSIX file ownership | ||
| 97 | 86 | # Cygwin's `ls -ld` reports the NTFS Owner SID via Cygwin's SID-to-uid | |
| 98 | 87 | # mapping (well-known SIDs by their RID, machine-local accounts by | |
| 99 | 88 | # 0x30000+RID). That mapping is what Cygwin git's | |
@@ -114,8 +103,7 @@ jobs: | |||
| 114 | 103 | ls -ld -- "$p" 2>/dev/null || echo "(missing: $p)" | |
| 115 | 104 | done | |
| 116 | 105 | ||
| 117 | - - &ownership-ntfs-display | ||
| 118 | - name: Show NTFS file ownership | ||
| 106 | + - name: Show NTFS file ownership | ||
| 119 | 107 | # Authoritative NTFS Owner via Get-Acl, with no Cygwin SID-to-uid layer | |
| 120 | 108 | # in between -- useful for confirming what the Cygwin view reports as | |
| 121 | 109 | # "Administrators" is the BUILTIN\Administrators SID (S-1-5-32-544). | |
@@ -145,8 +133,7 @@ jobs: | |||
| 145 | 133 | } | |
| 146 | 134 | } | |
| 147 | 135 | ||
| 148 | - - &safe-directory-display | ||
| 149 | - name: Show safe.directory entries | ||
| 136 | + - name: Show safe.directory entries | ||
| 150 | 137 | run: git config --global --get-all safe.directory | |
| 151 | 138 | ||
| 152 | 139 | - name: Show version and platform information | |
@@ -160,104 +147,3 @@ jobs: | |||
| 160 | 147 | - name: Test with pytest (${{ matrix.additional-pytest-args }}) | |
| 161 | 148 | run: | | |
| 162 | 149 | pytest --color=yes -p no:sugar --instafail -vv ${{ matrix.additional-pytest-args }} | |
| 163 | - | ||
| 164 | - diag-token: | ||
| 165 | - runs-on: windows-latest | ||
| 166 | - | ||
| 167 | - env: *cygwin-env | ||
| 168 | - | ||
| 169 | - defaults: *cygwin-defaults | ||
| 170 | - | ||
| 171 | - steps: | ||
| 172 | - - *force-lf | ||
| 173 | - - *checkout | ||
| 174 | - - *install-cygwin | ||
| 175 | - | ||
| 176 | - - name: PowerShell-side token state and file-creation tests | ||
| 177 | - shell: pwsh | ||
| 178 | - run: | | ||
| 179 | - $repo = "D:\a\GitPython\GitPython" | ||
| 180 | - Write-Host "==================== whoami /all (PowerShell) ====================" | ||
| 181 | - whoami /all | ||
| 182 | - Write-Host "" | ||
| 183 | - Write-Host "==================== Test A: PowerShell New-Item directory ====================" | ||
| 184 | - $td = "$repo\test-pwsh-mkdir" | ||
| 185 | - New-Item -ItemType Directory -Path $td -Force | Out-Null | ||
| 186 | - $acl = Get-Acl -LiteralPath $td | ||
| 187 | - Write-Host "Owner of $td : $($acl.Owner)" | ||
| 188 | - Remove-Item $td -Force | ||
| 189 | - Write-Host "" | ||
| 190 | - Write-Host "==================== Test D: PowerShell -> Git Bash -> PowerShell New-Item ====================" | ||
| 191 | - $td4 = "$repo\test-pwsh-bash-pwsh-mkdir" | ||
| 192 | - $scriptPath = "$repo\inner-mkdir.ps1" | ||
| 193 | - "New-Item -ItemType Directory -Path '$td4' -Force | Out-Null" | | ||
| 194 | - Set-Content -Path $scriptPath -Encoding utf8 | ||
| 195 | - $env:MSYS2_ARG_CONV_EXCL = '*' | ||
| 196 | - try { | ||
| 197 | - & "C:\Program Files\Git\bin\bash.exe" -c "powershell.exe -NoProfile -ExecutionPolicy Bypass -File '$scriptPath'" 2>&1 | Out-Null | ||
| 198 | - } finally { | ||
| 199 | - Remove-Item Env:MSYS2_ARG_CONV_EXCL -ErrorAction SilentlyContinue | ||
| 200 | - } | ||
| 201 | - if (Test-Path -LiteralPath $td4) { | ||
| 202 | - $acl = Get-Acl -LiteralPath $td4 | ||
| 203 | - Write-Host "Owner of $td4 (PowerShell -> bash -> PowerShell New-Item) : $($acl.Owner)" | ||
| 204 | - Remove-Item $td4 -Force | ||
| 205 | - } else { | ||
| 206 | - Write-Host "Owner of $td4 (PowerShell -> bash -> PowerShell New-Item) : (directory not created)" | ||
| 207 | - } | ||
| 208 | - Remove-Item $scriptPath -Force -ErrorAction SilentlyContinue | ||
| 209 | - | ||
| 210 | - - name: Cygwin-side token state and file-creation tests | ||
| 211 | - run: | | ||
| 212 | - set +e | ||
| 213 | - echo "==================== id (Cygwin) ====================" | ||
| 214 | - id | ||
| 215 | - echo | ||
| 216 | - echo "==================== Test B: Cygwin mkdir ====================" | ||
| 217 | - td="$(pwd)/test-cygwin-mkdir" | ||
| 218 | - mkdir "$td" | ||
| 219 | - echo "Owner: $(stat -c '%U(%u)' "$td")" | ||
| 220 | - rmdir "$td" | ||
| 221 | - echo | ||
| 222 | - echo "==================== Test C: Cygwin-spawned Git for Windows git init ====================" | ||
| 223 | - td3="$(pwd)/test-cygwin-spawns-wingit" | ||
| 224 | - mkdir "$td3" | ||
| 225 | - ( cd "$td3" && /cygdrive/c/Program\ Files/Git/bin/git.exe init -q ) | ||
| 226 | - echo "Owner of $td3 (Cygwin-mkdir) : $(stat -c '%U(%u)' "$td3")" | ||
| 227 | - echo "Owner of $td3/.git (Cygwin->Win git init): $(stat -c '%U(%u)' "$td3/.git")" | ||
| 228 | - rm -rf "$td3" | ||
| 229 | - true | ||
| 230 | - | ||
| 231 | - reproduce-safe-dir: | ||
| 232 | - strategy: | ||
| 233 | - matrix: | ||
| 234 | - run: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256] | ||
| 235 | - fail-fast: false | ||
| 236 | - | ||
| 237 | - runs-on: windows-latest | ||
| 238 | - | ||
| 239 | - env: *cygwin-env | ||
| 240 | - | ||
| 241 | - defaults: *cygwin-defaults | ||
| 242 | - | ||
| 243 | - steps: | ||
| 244 | - - *force-lf | ||
| 245 | - - *checkout | ||
| 246 | - - *install-cygwin | ||
| 247 | - - *verbose-output | ||
| 248 | - - *safe-directory | ||
| 249 | - - *prepare-repo | ||
| 250 | - - *git-identity | ||
| 251 | - - *setup-venv | ||
| 252 | - - *update-pypa | ||
| 253 | - - *install-deps | ||
| 254 | - - *ownership-posix-display | ||
| 255 | - - *ownership-ntfs-display | ||
| 256 | - - *safe-directory-display | ||
| 257 | - | ||
| 258 | - - name: Run submodule tests | ||
| 259 | - run: | | ||
| 260 | - python -m pytest -vv \ | ||
| 261 | - test/test_docs.py::Tutorials::test_submodules \ | ||
| 262 | - test/test_repo.py::TestRepo::test_submodules \ | ||
| 263 | - test/test_submodule.py::TestSubmodule::test_root_module | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments