Skip to content

Commit

Permalink
CI Windows: try to avoid what is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Dec 18, 2024
1 parent 87259f3 commit 34abd63
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .github/debug_which_hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@
print(hg)
print(hg.read_text(encoding="utf-8"))
print(sorted(hg.parent.glob("*")))

hg_py = hg.with_name("hg")
if hg_py.exists():
print(hg_py)
print(hg_py.read_text(encoding="utf-8"))
35 changes: 24 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,10 @@ jobs:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Remove system Mercurial on Windows
run: |
python .github/remove_old_mercurial.py
- name: Install Mercurial with UV
- if: runner.os != 'Windows'
name: Install Mercurial with UV
run: |
uv tool install mercurial --with hg-git --with hg-evolve
- name: Check Mercurial installation
run: |
python .github/debug_which_hg.py
hg version -v
hg debuginstall
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
Expand All @@ -35,13 +28,33 @@ jobs:
run: pdm sync --clean
- name: Run tests
run: pdm run pytest --cov=hg_setup tests
- if: runner.os == 'Windows'
name: Remove system Mercurial on Windows
run: |
python .github/remove_old_mercurial.py
- if: runner.os == 'Windows'
name: Install Mercurial with UV
run: |
uv tool install mercurial --with hg-git --with hg-evolve
# hg installed with uv is broken on Windows
- if: runner.os == 'Windows'
name: Check Mercurial installation
run: |
python .github/debug_which_hg.py
- if: runner.os != 'Windows'
name: Mercurial installation
run: |
hg version -v
hg debuginstall
- name: Check real life usage
run: |
pdm run hg-setup -h
pdm run hg-setup init --auto
cd $HOME
python -c "import os; name = '.hgrc' if os.name != 'nt' else 'mercurial.ini'; file = open(name); print(file.readlines()[:4])"
hg version -v
hg debuginstall
# hg installed with uv is broken on Windows
- if: runner.os != 'Windows'
name: Check clone of a Git repo
run: |
hg clone https://github.com/fluiddyn/hg-setup.git
cd hg-setup

0 comments on commit 34abd63

Please sign in to comment.