forked from marin-community/marin
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 2.05 KB
/
unit-tests.yaml
File metadata and controls
74 lines (66 loc) · 2.05 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
name: Run unit tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
strategy:
matrix:
python-version: ["3.12"]
node-version: ["20.10.0"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2
with:
pandoc-version: '3.1.11' # Pin version for cache consistency
- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.cache/uv
~/.npm
~/node_modules
key: ${{ runner.os }}-deps-v1-${{ hashFiles('uv.lock') }}
restore-keys: |
${{ runner.os }}-deps-v1-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "uv>=0.7.19" toml
npm install -g pandiff
uv sync --dev --extra=cpu
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.NEW_GCP_JSON }}
- name: Test with pytest
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
CI: true
run: |
PYTHONPATH=tests:. uv run --extra=cpu pytest -n3 --durations=5 --tb=no -m 'not slow' -vv tests/