| 1 |
name: main-ci |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
pull_request: |
| 8 |
branches: |
| 9 |
- master |
| 10 |
|
| 11 |
jobs: |
| 12 |
format: |
| 13 |
# check formatting with ruff |
| 14 |
runs-on: ubuntu-latest |
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v5 |
| 17 |
|
| 18 |
- name: Set up Python |
| 19 |
uses: actions/setup-python@v5 |
| 20 |
with: |
| 21 |
python-version: 3.14 |
| 22 |
|
| 23 |
- name: Install uv |
| 24 |
uses: astral-sh/setup-uv@v6 |
| 25 |
with: |
| 26 |
# Install a specific version of uv. |
| 27 |
version: "0.8.13" |
| 28 |
python-version: 3.14 |
| 29 |
|
| 30 |
- name: Install dependencies |
| 31 |
run: | |
| 32 |
uv sync |
| 33 |
|
| 34 |
- name: Format check |
| 35 |
run: | |
| 36 |
uv run -- ruff check --select I . |
| 37 |
uv run -- ruff format --diff |
| 38 |
|
| 39 |
- name: Lint check |
| 40 |
run: | |
| 41 |
uv run -- ruff check . |
| 42 |
|
| 43 |
build: |
| 44 |
runs-on: ubuntu-latest |
| 45 |
|
| 46 |
steps: |
| 47 |
- uses: actions/checkout@v5 |
| 48 |
|
| 49 |
- name: Install uv |
| 50 |
uses: astral-sh/setup-uv@v6 |
| 51 |
with: |
| 52 |
# Install a specific version of uv. |
| 53 |
version: "0.8.13" |
| 54 |
python-version: 3.14 |
| 55 |
|
| 56 |
- name: 🏗️ Build Wheels etc |
| 57 |
run: | |
| 58 |
make |
| 59 |
|
| 60 |
- uses: actions/upload-artifact@v4 |
| 61 |
with: |
| 62 |
name: wheels-and-sdist |
| 63 |
path: dist |
| 64 |
|
| 65 |
test: |
| 66 |
runs-on: ubuntu-latest |
| 67 |
container: |
| 68 |
image: ghcr.io/dtrx-py/dtrx:2025-11-03 |
| 69 |
# we need tty for the test for password zip noninteractive prompt |
| 70 |
# we need to be root for checkout to work without pain |
| 71 |
options: "-t --user=root" |
| 72 |
|
| 73 |
strategy: |
| 74 |
fail-fast: false |
| 75 |
matrix: |
| 76 |
python: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 77 |
|
| 78 |
steps: |
| 79 |
- uses: actions/checkout@v5 |
| 80 |
|
| 81 |
- name: 🧪 Run Tests |
| 82 |
run: | |
| 83 |
# switch to a non-root user; this is required for one of the dtrx |
| 84 |
# tests, which checks for an EACCESS error :/ |
| 85 |
chown -R testuser:testuser . |
| 86 |
su testuser --pty -c "uv run --python ${{ matrix.python }} -- tests/compare.py" |
| 87 |
|
| 88 |
test-missing-file-command: |
| 89 |
runs-on: ubuntu-latest |
| 90 |
|
| 91 |
steps: |
| 92 |
- uses: actions/checkout@v5 |
| 93 |
|
| 94 |
# build the Docker image we use to run the tests |
| 95 |
- name: ✅ Test When `file` Command Not Present |
| 96 |
run: | |
| 97 |
./tools/test-nonexistent-file-cmd.sh |
| 98 |
|
| 99 |
manpage: |
| 100 |
runs-on: ubuntu-latest |
| 101 |
|
| 102 |
steps: |
| 103 |
- uses: actions/checkout@v5 |
| 104 |
|
| 105 |
- name: Install uv |
| 106 |
uses: astral-sh/setup-uv@v6 |
| 107 |
with: |
| 108 |
# Install a specific version of uv. |
| 109 |
version: "0.8.13" |
| 110 |
python-version: 3.14 |
| 111 |
|
| 112 |
# build the Docker image we use to run the tests |
| 113 |
- name: 📝 Generate Man Pages |
| 114 |
run: tools/gen-manpage.sh archived/README dtrx.1 |
| 115 |
|
| 116 |
# upload-artifact to save the generated manpage |
| 117 |
- uses: actions/upload-artifact@v4 |
| 118 |
with: |
| 119 |
name: manpage-output |
| 120 |
path: dtrx.1 |
| 121 |
|
| 122 |
windows: |
| 123 |
runs-on: ubuntu-latest |
| 124 |
|
| 125 |
steps: |
| 126 |
- uses: actions/checkout@v5 |
| 127 |
|
| 128 |
- name: Install uv |
| 129 |
uses: astral-sh/setup-uv@v6 |
| 130 |
with: |
| 131 |
# Install a specific version of uv. |
| 132 |
version: "0.8.13" |
| 133 |
python-version: 3.14 |
| 134 |
|
| 135 |
- name: 🪟 Verify Windows Install Fails |
| 136 |
run: ./tools/test-windows-install-fails.sh |