-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (64 loc) · 2.33 KB
/
build.yml
File metadata and controls
68 lines (64 loc) · 2.33 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
---
name: build
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12', '3.9', '3.10', '3.11']
fail-fast: false
env:
# cache busting if requirements haven't changed
CACHE_EPOCH: 1
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
- name: Cache pre-commit
uses: actions/cache@v5
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install cookiecutter build
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git config --global init.defaultBranch main
- name: with neither git nor pre-commit
run: |
GIT=$(which git)
sudo chmod -x ${GIT}
cookiecutter -v --no-input -f -o /tmp/cookie_python . project_slug=foo1-bar minimum_python_version=${{ matrix.python-version }}
python -m pip install /tmp/cookie_python/foo1-bar
python -c "import foo1_bar; print(foo1_bar.__version__)"
python -m pip uninstall -y foo1
sudo chmod +x ${GIT}
- name: with git only
run: |
cookiecutter -v --no-input -f -o /tmp/cookie_python . project_slug=foo2 minimum_python_version=${{ matrix.python-version }}
python -m pip install /tmp/cookie_python/foo2
python -m pip uninstall -y foo2
- name: with git and pre-commit
run: |
python -m pip install pre-commit
cookiecutter -v --no-input -f -o /tmp/cookie_python . project_slug=foo3 minimum_python_version=${{ matrix.python-version }}
python -m pip install /tmp/cookie_python/foo3
python -m pip uninstall -y foo3
cd /tmp/cookie_python/foo3
python -c "import tests"
python -m pip install .[dev]
make -C docs html
- name: upload generated projects
uses: actions/upload-artifact@v7
with:
name: cookie_python_${{ matrix.python-version }}
path: /tmp/cookie_python