-
-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (55 loc) · 1.58 KB
/
build.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
name: build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-python:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set up python ${{ matrix.python-version }} (${{ matrix.os }})
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install cli tools
run: |
python -m pip install --upgrade phosphorus yamk uv
- name: Create and activate a virtual environment (${{ matrix.os }})
shell: bash
if: ${{ runner.os != 'Windows' }}
run: |
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: Create and activate a virtual environment (${{ matrix.os }})
shell: pwsh
if: ${{ runner.os == 'Windows' }}
run: |
uv venv .venv
"VIRTUAL_ENV=.venv" | Out-File -FilePath $env:GITHUB_ENV -Append
"$PWD/.venv/Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: Use cache
uses: actions/cache@v4
with:
path: .venv
key: ${{ matrix.os }}-${{ matrix.python-version }}-lint-${{ hashFiles('pyproject.toml') }}
- name: Build the project
run: |
yam -e build