-
Notifications
You must be signed in to change notification settings - Fork 6
123 lines (110 loc) · 3.47 KB
/
Copy pathbuild.yml
File metadata and controls
123 lines (110 loc) · 3.47 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
# Appose Python CI Build
#
# Caching Strategy:
# 1. Maven dependencies (via setup-java cache: 'maven')
# 2. Appose environments and tool binaries (~/.local/share/appose)
# - Includes pixi, uv, and micromamba executables
# - Includes built environments
# 3. Pixi package cache (rattler cache):
# - Linux: ~/.cache/rattler/cache
# - macOS: ~/Library/Caches/rattler/cache
# - Windows: ~/AppData/Local/rattler/cache
# 4. uv package cache:
# - Linux: ~/.cache/uv
# - macOS: ~/Library/Caches/uv
# - Windows: ~/AppData/Local/uv/cache
# 5. Micromamba package cache:
# - All platforms: ~/.local/share/mamba/pkgs and ~/.mamba/pkgs
#
# Cache keys are based on:
# - tests/resources/envs/* hash (test environment specs change)
# - uv.lock hash (package dependencies change)
#
# This prevents redundant downloads of ~100MB+ tool binaries and packages on every CI run.
name: build
on:
push:
branches:
- main
tags:
- "*-[0-9]+.*"
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
cache: 'maven'
cache-dependency-path: 'appose.pom'
- name: Set up uv
run: |
python -m pip install --upgrade pip
python -m pip install uv
- name: Cache Appose environments and tools
uses: actions/cache@v4
with:
path: ~/.local/share/appose
key: ${{ runner.os }}-appose-py${{ matrix.python-version }}-${{ hashFiles('tests/resources/envs/**') }}-${{ hashFiles('pyproject.toml', 'uv.lock') }}
restore-keys: |
${{ runner.os }}-appose-py${{ matrix.python-version }}-${{ hashFiles('tests/resources/envs/**') }}-
${{ runner.os }}-appose-py${{ matrix.python-version }}-
${{ runner.os }}-appose-
- name: Cache Pixi packages (Rattler cache)
uses: actions/cache@v4
with:
path: |
~/.cache/rattler/cache
~/Library/Caches/rattler/cache
~/AppData/Local/rattler/cache
key: ${{ runner.os }}-pixi-pkgs-${{ hashFiles('tests/resources/envs/**') }}
restore-keys: |
${{ runner.os }}-pixi-pkgs-
- name: Cache uv packages
uses: actions/cache@v4
with:
path: |
~/.cache/uv
~/Library/Caches/uv
~/AppData/Local/uv/cache
key: ${{ runner.os }}-uv-pkgs-${{ hashFiles('tests/resources/envs/**', 'uv.lock') }}
restore-keys: |
${{ runner.os }}-uv-pkgs-
- name: Cache Micromamba packages
uses: actions/cache@v4
with:
path: |
~/.local/share/mamba/pkgs
~/.mamba/pkgs
~/AppData/Roaming/.mamba/pkgs
~/AppData/Roaming/mamba/pkgs
key: ${{ runner.os }}-mamba-pkgs-${{ hashFiles('tests/resources/envs/**') }}
restore-keys: |
${{ runner.os }}-mamba-pkgs-
- name: Run the tests
shell: bash
env:
UV_PYTHON: ${{ matrix.python-version }}
run: |
bin/test.sh
- name: Lint the code
shell: bash
env:
UV_PYTHON: ${{ matrix.python-version }}
run: |
bin/lint.sh