-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (46 loc) · 1.65 KB
/
Copy pathpackage-check.yml
File metadata and controls
58 lines (46 loc) · 1.65 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
name: Package Check
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: package-check-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
package-check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 1
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Install build tooling
uses: ./.github/actions/setup-hatch
- name: Install test and distribution tooling
run: python -m pip install ".[test]" "twine>=4.0.0"
- name: Run unit tests
run: python -m pytest -q tests/unit
- name: Build distributions
run: hatch build
- name: Validate distributions
run: python -m twine check dist/*
- name: Install and smoke-test wheel
run: |
python -m venv "$RUNNER_TEMP/package-check"
"$RUNNER_TEMP/package-check/bin/pip" install --upgrade pip
"$RUNNER_TEMP/package-check/bin/pip" install dist/*.whl
"$RUNNER_TEMP/package-check/bin/python" -c "import socketdev; from socketdev.version import __version__; print('wheel smoke OK', __version__)"
- name: Upload distributions
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: socketdev-${{ github.sha }}
path: dist/*
if-no-files-found: error
retention-days: 14