Skip to content

Commit 59db555

Browse files
committed
Update README with 1st and 3rd party sections
1 parent b0deae3 commit 59db555

File tree

5 files changed

+100
-75
lines changed

5 files changed

+100
-75
lines changed

.github/workflows/basic.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ jobs:
2020
cache: pip
2121

2222
- name: Show python version
23-
run: |
24-
python --version
25-
pip --version
23+
run: python --version && pip --version
2624

2725
- name: Install python dependencies
2826
run: |

.github/workflows/parallel_dir.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,29 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
- uses: astral-sh/setup-uv@v6
19+
- uses: actions/setup-python@v5
2020
with:
21-
enable-cache: true
21+
python-version-file: .python-version
22+
cache: pip
23+
24+
- name: Show python version
25+
run: python --version && pip --version
2226

2327
- name: Install python dependencies
2428
run: |
25-
uv python install; echo
26-
uv sync --locked; echo
27-
uv tree
29+
pip install --upgrade pip setuptools wheel
30+
pip install --requirement requirements.txt
2831
2932
- name: Collect tests
3033
run: |
31-
uv run -- pytest --collect-only --quiet | tee collected.tmp
34+
pytest --collect-only --quiet | tee collected.tmp
3235
echo '::group::Delete the last two lines'
3336
sed -e '$d' collected.tmp | sed -e '$d' | tee collected.txt
3437
echo '::endgroup::'
3538
3639
- name: Build test matrix
3740
id: build
38-
shell: uv run -- python {0}
41+
shell: python
3942
run: |
4043
from os import environ
4144
from pathlib import Path
@@ -60,15 +63,18 @@ jobs:
6063
steps:
6164
- uses: actions/checkout@v4
6265

63-
- uses: astral-sh/setup-uv@v6
66+
- uses: actions/setup-python@v5
6467
with:
65-
enable-cache: true
68+
python-version-file: .python-version
69+
cache: pip
70+
71+
- name: Show python version
72+
run: python --version && pip --version
6673

6774
- name: Install python dependencies
6875
run: |
69-
uv python install; echo
70-
uv sync --locked; echo
71-
uv tree
76+
pip install --upgrade pip setuptools wheel
77+
pip install --requirement requirements.txt
7278
7379
- name: Set pytest norecursedirs
7480
# Prevent the test runner from recursing into subdirectories. This
@@ -79,4 +85,4 @@ jobs:
7985
8086
- name: Run test
8187
# Quote the matrix argument because the path may contain spaces.
82-
run: uv run -- pytest '${{ matrix.directory }}'
88+
run: pytest '${{ matrix.directory }}'

.github/workflows/parallel_file.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,29 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
- uses: astral-sh/setup-uv@v6
19+
- uses: actions/setup-python@v5
2020
with:
21-
enable-cache: true
21+
python-version-file: .python-version
22+
cache: pip
23+
24+
- name: Show python version
25+
run: python --version && pip --version
2226

2327
- name: Install python dependencies
2428
run: |
25-
uv python install; echo
26-
uv sync --locked; echo
27-
uv tree
29+
pip install --upgrade pip setuptools wheel
30+
pip install --requirement requirements.txt
2831
2932
- name: Collect tests
3033
run: |
31-
uv run -- pytest --collect-only --quiet | tee collected.tmp
34+
pytest --collect-only --quiet | tee collected.tmp
3235
echo '::group::Delete the last two lines'
3336
sed -e '$d' collected.tmp | sed -e '$d' | tee collected.txt
3437
echo '::endgroup::'
3538
3639
- name: Build test matrix
3740
id: build
38-
shell: uv run -- python {0}
41+
shell: python
3942
run: |
4043
from os import environ
4144
@@ -70,17 +73,20 @@ jobs:
7073
steps:
7174
- uses: actions/checkout@v4
7275

73-
- uses: astral-sh/setup-uv@v6
76+
- uses: actions/setup-python@v5
7477
with:
75-
enable-cache: true
78+
python-version-file: .python-version
79+
cache: pip
80+
81+
- name: Show python version
82+
run: python --version && pip --version
7683

7784
- name: Install python dependencies
7885
run: |
79-
uv python install; echo
80-
uv sync --locked; echo
81-
uv tree
86+
pip install --upgrade pip setuptools wheel
87+
pip install --requirement requirements.txt
8288
8389
- name: Run test
8490
# Don't quote the matrix argument because it causes the shell
8591
# to treat the entire list of paths as a single argument.
86-
run: uv run -- pytest ${{ matrix.paths }}
92+
run: pytest ${{ matrix.paths }}

.github/workflows/uv.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,12 @@ jobs:
2424
uv sync --locked; echo
2525
uv tree
2626
27+
- name: Python shell with uv
28+
shell: uv run -- python {0}
29+
run: |
30+
import sys
31+
print(f"Running: {sys.version}")
32+
print("Hello, World!")
33+
2734
- name: Run test
2835
run: uv run -- pytest tests/test_basic.py

README.md

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
A collection of small GitHub Actions workflows demonstrating various capabilities and features to get you started.
44

5-
## basic.yml
5+
## 1st Party
6+
7+
These examples use only tools and actions from GitHub.
8+
9+
### basic.yml
610

711
<details>
812

@@ -22,7 +26,7 @@ See the [workflow](.github/workflows/basic.yml) and [dependabot](.github/dependa
2226

2327
</details>
2428

25-
## branch_name.yml
29+
### branch_name.yml
2630

2731
<details>
2832

@@ -45,7 +49,7 @@ See the [workflow](.github/workflows/branch_name.yml).
4549

4650
</details>
4751

48-
## cache.yml
52+
### cache.yml
4953

5054
<details>
5155

@@ -59,7 +63,7 @@ See the [workflow](.github/workflows/cache.yml).
5963

6064
</details>
6165

62-
## context.yml
66+
### context.yml
6367

6468
<details>
6569

@@ -71,7 +75,7 @@ See the [workflow](.github/workflows/context.yml).
7175

7276
</details>
7377

74-
## env_var_*.yml
78+
### env_var_*.yml
7579

7680
<details>
7781

@@ -91,7 +95,7 @@ See the workflows:
9195

9296
</details>
9397

94-
## github_script.yml
98+
### github_script.yml
9599

96100
<details>
97101

@@ -105,21 +109,7 @@ See the [workflow](.github/workflows/github_script.yml).
105109

106110
</details>
107111

108-
## homebrew.yml
109-
110-
<details>
111-
112-
<summary>Using homebrew in your workflow.</summary>
113-
114-
<br/>Leverage the convenience of homebrew to install applications on GitHub Actions runners.
115-
116-
- Uses `Homebrew/actions/setup-homebrew`
117-
118-
See the [workflow](.github/workflows/homebrew.yml).
119-
120-
</details>
121-
122-
## job_summary.yml
112+
### job_summary.yml
123113

124114
<details>
125115

@@ -135,7 +125,7 @@ See the [workflow](.github/workflows/job_summary.yml).
135125

136126
</details>
137127

138-
## log_annotation.yml
128+
### log_annotation.yml
139129

140130
<details>
141131

@@ -147,7 +137,7 @@ See the [workflow](.github/workflows/log_annotation.yml).
147137

148138
</details>
149139

150-
## matrix.yml
140+
### matrix.yml
151141

152142
<details>
153143

@@ -161,63 +151,81 @@ See the [workflow](.github/workflows/matrix.yml).
161151

162152
</details>
163153

164-
## mise.yml
154+
### parallel_*.yml
165155

166156
<details>
167157

168-
<summary>Using mise in your workflow.</summary>
158+
<summary>Parallel testing without any code changes or extra dependencies.</summary>
169159

170-
<br/>The polyglot tool version manager.
160+
<br/>The matrix strategy can be used in a particular way to enable parallel testing for free. "Free" meaning no code changes and no extra dependencies. This example uses Python, but can be adapted to any language. The idea is to identify where your tests are and distrubute them across multiple GitHub Actions runners. If your testing framework supports parallel testing, you can use it together with this strategy to really go fast!
171161

172-
- Uses `jdx/mise-action`
162+
Note: This will increase the number of runners used, so keep an eye on your usage to avoid billing surprises.
173163

174-
See the [workflow](.github/workflows/mise.yml).
164+
See the workflows:
165+
- [Directory-level parallel testing](.github/workflows/parallel_dir.yml)
166+
- [File-level parallel testing](.github/workflows/parallel_file.yml)
175167

176168
</details>
177169

178-
## parallel_*.yml
170+
### workflow_input.yml
179171

180172
<details>
181173

182-
<summary>Parallel testing without any code changes or extra dependencies.</summary>
174+
<summary>Adjust how a workflow will run with custom input.</summary>
183175

184-
<br/>The matrix strategy can be used in a particular way to enable parallel testing for free. "Free" meaning no code changes and no extra dependencies. This example uses Python, but can be adapted to any language. The idea is to identify where your tests are and distrubute them across multiple GitHub Actions runners. If your testing framework supports parallel testing, you can use it together with this strategy to really go fast!
176+
<br/>When using the `workflow_dispatch` event, you can optionally specify inputs that are passed to the workflow.
185177

186-
Note: This will increase the number of runners used, so keep an eye on your usage to avoid billing surprises.
178+
This trigger only receives events when the workflow file is on the default branch. This means you have to merge your changes to `main` or `master` before you can test your inputs. It would be wise to try input changes in a totally separate workflow before merging them into critical workflows.
187179

188-
See the workflows:
189-
- [Directory-level parallel testing](.github/workflows/parallel_dir.yml)
190-
- [File-level parallel testing](.github/workflows/parallel_file.yml)
180+
Also, if the event that triggers the workflow isn't `workflow_dispatch` the input values are empty/null. This is true even if you have default values defined.
181+
182+
See the [workflow](.github/workflows/workflow_input.yml).
191183

192184
</details>
193185

194-
## uv.yml
186+
## 3rd Party
187+
188+
These examples include tools and actions from 3rd parties.
189+
190+
### homebrew.yml
195191

196192
<details>
197193

198-
<summary>Using uv in your workflow.</summary>
194+
<summary>Using homebrew in your workflow.</summary>
199195

200-
<br/>Same as basic.yml but uses the uv project manager.
196+
<br/>Leverage the convenience of homebrew to install applications on GitHub Actions runners.
201197

202-
- Uses `astral-sh/setup-uv`
198+
- Uses `Homebrew/actions/setup-homebrew`
203199

204-
See the [workflow](.github/workflows/uv.yml).
200+
See the [workflow](.github/workflows/homebrew.yml).
205201

206202
</details>
207203

208-
## workflow_input.yml
204+
### mise.yml
209205

210206
<details>
211207

212-
<summary>Adjust how a workflow will run with custom input.</summary>
208+
<summary>Using mise in your workflow.</summary>
213209

214-
<br/>When using the `workflow_dispatch` event, you can optionally specify inputs that are passed to the workflow.
210+
<br/>The polyglot tool and project manager.
215211

216-
This trigger only receives events when the workflow file is on the default branch. This means you have to merge your changes to `main` or `master` before you can test your inputs. It would be wise to try input changes in a totally separate workflow before merging them into critical workflows.
212+
- Uses `jdx/mise-action`
217213

218-
Also, if the event that triggers the workflow isn't `workflow_dispatch` the input values are empty/null. This is true even if you have default values defined.
214+
See the [workflow](.github/workflows/mise.yml).
219215

220-
See the [workflow](.github/workflows/workflow_input.yml).
216+
</details>
217+
218+
### uv.yml
219+
220+
<details>
221+
222+
<summary>Using uv in your workflow.</summary>
223+
224+
<br/>Same as basic.yml but uses the uv Python project manager.
225+
226+
- Uses `astral-sh/setup-uv`
227+
228+
See the [workflow](.github/workflows/uv.yml).
221229

222230
</details>
223231

0 commit comments

Comments
 (0)