Repository navigation
74 lines (69 loc) · 2.95 KB
/
Copy pathci.yml
File metadata and controls
74 lines (69 loc) · 2.95 KB
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
name: ci
on:
push:
branches: [main]
pull_request:
# Least privilege by default; jobs that need more request it explicitly.
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# ubuntu-24.04, not ubuntu-latest: ubuntu-latest became 26.04, which setup-python has no 3.9 for.
os: [ubuntu-24.04, macos-latest, windows-latest]
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ matrix.python }}
- run: python -m pip install --upgrade pip
- run: python -m pip install pytest
- run: python -m pytest -q
- name: CLI smoke test
shell: bash
run: |
echo '{"items":[{"id":"box","quantity":8,"dimensions":{"length":"50","width":"50","height":"50"}}],
"containers":[{"id":"carton","inner_dimensions":{"length":"100","width":"100","height":"100"}}]}' \
| PYTHONPATH=src python -m packvium > result.json
python -c "import json,sys; r=json.load(open('result.json')); sys.exit(0 if r['complete'] else 1)"
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "3.12"
- run: python -m pip install --upgrade pip build twine
- run: python -m build
- run: python -m twine check --strict dist/*
- name: Install the built wheel into a clean environment and re-run the tests
run: |
python -m venv /tmp/clean
/tmp/clean/bin/python -m pip install --quiet pytest
/tmp/clean/bin/python -m pip install --quiet --no-index --find-links dist packvium
/tmp/clean/bin/python -m pytest tests -q
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: distributions
path: dist/
# Fails a pull request that introduces a dependency with a known vulnerability or a
# licence the project has not accepted. It reads GitHub's dependency graph, so it needs
# nothing committed here beyond this job -- and on a package with no runtime
# dependencies its usual answer is "nothing changed", which is the answer we want to
# keep true rather than assume.
dependency-review:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
- uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
with:
fail-on-severity: low
comment-summary-in-pr: on-failure