-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (76 loc) · 2.34 KB
/
push.yaml
File metadata and controls
79 lines (76 loc) · 2.34 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
# After successful versioning, this script runs various
# parts of the push process
name: Push
on:
push:
branches:
- main
paths:
- pyproject.toml
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "ruff>=0.9.0"
- name: Check formatting
run: ruff format --check .
test:
name: Build and test
runs-on: ubuntu-latest
permissions:
contents: "write"
# Required to auth against gcp
id-token: "write"
env:
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: "google-github-actions/auth@v2"
with:
workload_identity_provider: "projects/322898545428/locations/global/workloadIdentityPools/policyengine-research-id-pool/providers/prod-github-provider"
service_account: "policyengine-research@policyengine-research.iam.gserviceaccount.com"
- name: Install package
run: uv pip install -e ".[dev]" --system
- name: Download data inputs
run: make download
env:
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
- name: Build datasets
run: make data
- name: Save calibration log (constituencies)
uses: actions/upload-artifact@v4
with:
name: constituency_calibration_log.csv
path: constituency_calibration_log.csv
- name: Save calibration log (local authorities)
uses: actions/upload-artifact@v4
with:
name: la_calibration_log.csv
path: la_calibration_log.csv
- name: Run tests
run: make test
- name: Upload data
run: make upload
env:
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
- name: Publish a git tag
run: ".github/publish-git-tag.sh"