-
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (107 loc) · 3.58 KB
/
Copy pathaction-test.yml
File metadata and controls
124 lines (107 loc) · 3.58 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Test Action
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test-basic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Create test project
run: |
mkdir -p test-project
cat > test-project/pyproject.toml << EOF
[project]
name = "test-project"
version = "0.1.0"
requires-python = ">=3.9"
dependencies = [
"requests>=2.31.0",
"pytest>=7.4.0",
]
EOF
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Generate lock file
working-directory: test-project
run: uv sync
- name: Test basic usage (with default uv sync command)
uses: ./
with:
pyproject-path: test-project/pyproject.toml
test-default-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Create test project
run: |
mkdir -p test-project
cat > test-project/pyproject.toml << EOF
[project]
name = "test-project"
version = "0.1.0"
requires-python = ">=3.9"
dependencies = [
"requests>=2.31.0",
"pytest>=7.4.0",
]
EOF
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Generate lock file
working-directory: test-project
run: uv sync
- name: Test with default uv sync command (no command specified)
uses: ./
with:
pyproject-path: test-project/pyproject.toml
test-requirements:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Create test project
run: |
mkdir -p test-project
cat > test-project/pyproject.toml << EOF
[project]
name = "test-project"
version = "0.1.0"
requires-python = ">=3.9"
dependencies = [
"requests>=2.31.0",
"pytest>=7.4.0",
]
EOF
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Generate lock and requirements files
working-directory: test-project
run: |
uv sync
uv pip compile pyproject.toml -o requirements.txt
- name: Test with requirements
uses: ./
with:
pyproject-path: test-project/pyproject.toml
requirements-path: test-project/requirements.txt
command: uv pip compile pyproject.toml -o requirements.txt
test-python-version-tilde:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Debug - List test-fixtures/python-version-tilde
run: |
pwd
ls -l ./test-fixtures/python-version-tilde
cat ./test-fixtures/python-version-tilde/pyproject.toml
- name: Run action
id: action_step
uses: ./
with:
pyproject-path: ./test-fixtures/python-version-tilde/pyproject.toml
command: uv sync --directory ./test-fixtures/python-version-tilde