-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.31 KB
/
python-ci.yaml
File metadata and controls
57 lines (46 loc) · 1.31 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
# .github/workflows/python-ci.yml
name: Python CI
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
jobs:
build:
runs-on: ubuntu-latest
env:
DATASTORE_EMULATOR_HOST: "localhost:8081"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Set up Java (required for Datastore emulator)
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
install_components: 'beta,cloud-datastore-emulator'
- name: 'Verify gcloud setup'
run: |
gcloud --version
which gcloud
gcloud components list --filter="id:cloud-datastore-emulator" --format="table(id,state.name)"
- name: 'Configure gcloud project'
run: 'gcloud config set project python-datastore-sqlalchemy'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then
pip install -r requirements.txt
else
echo "No requirements.txt found"
fi
- name: Run tests
run: |
pytest