CI: try to remove old Mercurial in Program Files #18
This file contains 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: CI Test | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python-version: ["3.11", "3.13"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v4 | |
- name: Remove system Mercurial on Windows | |
run: | | |
python -c "from shutil import rmtree as rm; from pathlib import Path; p = Path(r'C:\Program Files\Mercurial'); if p.exists(): rm(p)" | |
- name: Install Mercurial with UV | |
run: | | |
uv tool install mercurial --with hg-git --with hg-evolve | |
- name: Check Mercurial installation | |
run: | | |
uvx hg version -v | |
uvx hg debuginstall | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pdm sync --clean | |
- name: Run tests | |
run: pdm run pytest --cov=hg_setup tests | |
- 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])" | |
uvx hg version -v | |
uvx hg debuginstall | |
uvx hg clone https://github.com/fluiddyn/hg-setup.git | |
cd hg-setup |