-
Notifications
You must be signed in to change notification settings - Fork 60
101 lines (95 loc) · 3.02 KB
/
Copy pathci.yml
File metadata and controls
101 lines (95 loc) · 3.02 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
name: CI Tests
on:
push:
branches:
- main
# Trigger on PRs (no forks)
pull_request:
branches:
- main
# Manual trigger
workflow_dispatch:
inputs:
ref:
description: 'Branch or Ref to test'
required: false
default: ''
permissions:
contents: read
jobs:
test-go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref || '' }}
# Persist credentials is false to prevent the PR code from using the GITHUB_TOKEN
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: '1.22'
- name: Run Go tests
working-directory: ./go
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: go test -timeout 20m ./...
test-java:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref || '' }}
persist-credentials: false
- name: Set up JDK 24
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
java-version: '24'
distribution: 'temurin'
cache: maven
- name: Run Java tests
working-directory: ./java
env:
GOOGLE_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: mvn -B test
test-javascript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref || '' }}
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- name: Install dependencies
working-directory: ./javascript
run: npm ci
- name: Run JavaScript tests
working-directory: ./javascript
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: node --test *.test.js
test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.ref || '' }}
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.11'
- name: Install dependencies
working-directory: ./python
run: pip install absl-py google-genai Pillow pyink pytest
- name: Run Python tests
working-directory: ./python
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
# Discover and run all .py files as tests
run: python -m unittest discover -p "*.py"