-
Notifications
You must be signed in to change notification settings - Fork 26
94 lines (85 loc) · 3.15 KB
/
build.yml
File metadata and controls
94 lines (85 loc) · 3.15 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
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
name: build
jobs:
py-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.py }})
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, py: "3.10" }
- { os: ubuntu-latest, py: "3.11" }
- { os: ubuntu-latest, py: "3.12" }
env:
UV_NO_SOURCES: "1"
steps:
- name: CHECKOUT CODE
uses: actions/checkout@v4
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: SETUP UV
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: SETUP PYTHON
run: uv python install ${{ matrix.config.py }}
- name: Install dependencies
run: |
# 使用 uv 安装依赖
uv sync --extra dev
# 针对 PyTorch Geometric 编译问题的解决方案
uv pip uninstall torch-scatter torch-sparse torch-cluster -y || true
uv pip install torch-geometric
# - name: Create hydro_setting.yml directly in workflow
# run: |
# echo "Creating hydro_setting.yml..."
# cat <<EOF > /root/hydro_setting.yml
# minio:
# server_url: ''
# client_endpoint: ''
# access_key: ''
# secret: ''
#
# local_data_path:
# root: ''
# datasets-origin: '/home/runner/.hydrodataset/cache/waterism/datasets-origin/camels/camels_us/' # set your path here
# datasets-interim: ''
# basins-origin: ''
# basins-interim: '/home/runner/.hydrodataset/cache/'
# cache: ''
#
# postgres:
# server_url: ''
# port: 0
# username: ''
# password: ''
# database: ''
# EOF
# cat /root/hydro_setting.yml || echo "Failed to read the file"
#
# - name: Download Camels data
# run: |
# uv run kaggle datasets download -d headwater/Camels -p /home/runner/.hydrodataset/cache/waterism/datasets-origin/camels/camels_us/ --unzip
# uv run kaggle datasets download -d headwater/Camels -p /home/runner/.hydrodataset/cache/ --unzip
# env:
# KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }}
# KAGGLE_KEY: ${{ secrets.KAGGLE_KEY }}
#
- name: PKG-TEST
run: |
uv run pytest -m "not requires_data and not requires_gpu" tests