| 1 |
on: |
| 2 |
- push |
| 3 |
- pull_request |
| 4 |
|
| 5 |
name: Main |
| 6 |
|
| 7 |
jobs: |
| 8 |
pre-commit: |
| 9 |
runs-on: ubuntu-latest |
| 10 |
steps: |
| 11 |
- uses: actions/checkout@v4 |
| 12 |
- uses: actions/setup-python@v5 |
| 13 |
with: |
| 14 |
python-version: '3.10' |
| 15 |
- run: | |
| 16 |
pip install poetry |
| 17 |
poetry install |
| 18 |
poetry run pre-commit run --all-files --show-diff-on-failure |
| 19 |
|
| 20 |
test: |
| 21 |
runs-on: ubuntu-22.04 |
| 22 |
strategy: |
| 23 |
fail-fast: false |
| 24 |
matrix: |
| 25 |
python-version: |
| 26 |
# - '3.5' |
| 27 |
# - '3.6' |
| 28 |
- '3.7' |
| 29 |
- '3.8' |
| 30 |
- '3.9' |
| 31 |
- '3.10' |
| 32 |
- '3.11' |
| 33 |
- '3.12' |
| 34 |
- '3.13' |
| 35 |
git-version: |
| 36 |
- default # 2.28.0 or newer |
| 37 |
include: |
| 38 |
- python-version: '3.7' |
| 39 |
git-version: '2.21.0' # https://lore.kernel.org/git/CAKqNo6RJqp94uLMf8Biuo=ZvMZB9Mq6RRMrUgsLW4u1ks+mnOA@mail.gmail.com/T/#u |
| 40 |
- python-version: '3.7' |
| 41 |
git-version: '2.7.0' |
| 42 |
- python-version: '3.7' |
| 43 |
git-version: '2.2.0' |
| 44 |
- python-version: '3.7' |
| 45 |
git-version: '1.8.2.3' |
| 46 |
name: test (python = ${{ matrix.python-version }}, git = ${{ matrix.git-version }}) |
| 47 |
env: |
| 48 |
DARCS_EMAIL: foo <[email protected]> |
| 49 |
steps: |
| 50 |
- if: ${{ matrix.python-version == '3.5' }} |
| 51 |
run: | |
| 52 |
echo "PIP_TRUSTED_HOST=pypi.python.org pypi.org files.pythonhosted.org" >> $GITHUB_ENV |
| 53 |
- uses: actions/checkout@v4 |
| 54 |
- uses: actions/setup-python@v5 |
| 55 |
with: |
| 56 |
python-version: ${{ matrix.python-version }} |
| 57 |
# - uses: dtolnay/[email protected] |
| 58 |
# - uses: Swatinem/rust-cache@v2 |
| 59 |
- if: ${{ matrix.git-version != 'default' }} |
| 60 |
env: |
| 61 |
NO_OPENSSL: 'yes' |
| 62 |
run: | |
| 63 |
sudo apt-get update |
| 64 |
sudo apt-get install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev |
| 65 |
curl -o git.tar.gz https://mirrors.edge.kernel.org/pub/software/scm/git/git-${{ matrix.git-version }}.tar.gz |
| 66 |
tar -zxf git.tar.gz |
| 67 |
cd git-${{ matrix.git-version }} |
| 68 |
make configure |
| 69 |
./configure --prefix=/usr |
| 70 |
sudo make install |
| 71 |
which git |
| 72 |
git --version |
| 73 |
- run: | |
| 74 |
export PATH="$PATH:/opt" |
| 75 |
sudo apt-get update |
| 76 |
sudo apt-get install -y darcs bzr |
| 77 |
# For Pijul: |
| 78 |
# sudo apt-get install -y libdbus-1-dev libsodium-dev libxxhash-dev libzstd-dev expect |
| 79 |
|
| 80 |
# rehosted because the official site deletes older artifacts: |
| 81 |
curl -L -o ~/fossil.tgz https://github.com/mtkennerly/storage/raw/06e29a4005b24a65bc7d639c0aa1fc152a85d0b7/software/fossil-linux-x64-2.13.tar.gz |
| 82 |
tar -xvf ~/fossil.tgz -C /opt |
| 83 |
# TODO: Re-enable Pijul tests once this is fixed: https://nest.pijul.org/pijul/pijul/discussions/953 |
| 84 |
# - name: Prepare Pijul |
| 85 |
# run: | |
| 86 |
# # Same as default features, but without openssl: |
| 87 |
# cargo install pijul --version 1.0.0-beta.11 --no-default-features --features keep-changes |
| 88 |
# pijul key new --no-link --no-prompt --display-name test --email '[email protected]' --expiry 3000-01-01T00:00:00Z --username test test |
| 89 |
- run: | |
| 90 |
export PATH="$PATH:/opt" |
| 91 |
|
| 92 |
git config --global user.name "foo" |
| 93 |
git config --global user.email "[email protected]" |
| 94 |
bzr whoami 'foo <[email protected]>' |
| 95 |
- if: ${{ matrix.python-version == '3.5' || matrix.python-version == '3.6' }} |
| 96 |
run: | |
| 97 |
cp poetry.legacy.lock poetry.lock |
| 98 |
- if: ${{ matrix.python-version == '3.12' || matrix.python-version == '3.13' }} |
| 99 |
run: | |
| 100 |
rm poetry.lock |
| 101 |
- run: | |
| 102 |
pip install poetry |
| 103 |
poetry install |
| 104 |
poetry run pytest --verbose --cov --cov-report term-missing |