-
-
Notifications
You must be signed in to change notification settings - Fork 2
89 lines (73 loc) · 2.1 KB
/
self-test.yml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: self-test
on:
pull_request:
branches:
- coatl
paths:
- '.github/workflows/self-test.yml'
- 'requirements/**'
- 'Dockerfile'
env:
devpi-password: abcd1234
devpi-username: root
devpi-port: 3141
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build container
run: |
docker build -t devpi .
- name: Run container
run: |
docker run \
--name devpi-server \
--detach \
--publish 3141:3141 \
--env DEVPI_PASSWORD=${{ env.devpi-password }} \
devpi
- name: Set up Python
uses: actions/setup-python@v5
id: setup-python
with:
python-version: '3.13'
- name: Install requirements
run: |
python -m pip install --requirement requirements/test.txt
- name: Create the stub package importable directory
run: |
mkdir -pv src/test_package
- name: Populate the stub package `__init__.py`
run: |
echo '__version__ = "0.1"' > src/test_package/__init__.py
- name: Populate the stub package `README.md`
run: |
echo "# Test Package" > README.md
- name: Populate the stub package `pyproject.toml`
run: echo "$CONTENTS" > pyproject.toml
env:
CONTENTS: |
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=61.2",
]
[project]
name = "test-package"
version = "0.1"
readme = "README.md"
- name: Build the stub package
run: |
python -m build
- name: Sleep
run: |
sleep 30
- name: Upload package
run: |
python -m twine upload --verbose dist/*
env:
TWINE_USERNAME: ${{ env.devpi-username }}
TWINE_PASSWORD: ${{ env.devpi-password }}
TWINE_REPOSITORY_URL: http://localhost:${{ env.devpi-port }}/${{ env.devpi-username }}/public/