Repository navigation
54 lines (45 loc) · 1.75 KB
/
Copy pathtest.yaml
File metadata and controls
54 lines (45 loc) · 1.75 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
name: Test
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]
# NOTE: when ran from a fork, the secrets will not be available -- just skip the
# job instead of failing
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'workflow_dispatch'
env:
SPEAKEASY_API_KEY: ${{ secrets.SPEAKEASY_API_KEY }}
# Overrides python in mise.toml for this job. Set on the job so later
# steps keep the matrix interpreter. 3.10 stays the mise.toml default.
MISE_PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Set up mise
uses: jdx/mise-action@v5.1.1
with:
version: "2026.10.4"
cache: true
cache_key: "{{default}}-python${{ matrix.python-version }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check Python version
run: python -c 'import sys; got="{}.{}".format(*sys.version_info[:2]); assert got == "${{ matrix.python-version }}", sys.version; print(sys.version)'
- name: "Ensure README-PYPI.md is created"
run: python scripts/prepare_readme.py
# run the glean target specified in .speakeasy/workflow.yaml
- run: speakeasy test --target glean
- name: Publish Test Results
uses: dorny/test-reporter@v1
if: ${{ !cancelled() }} # run even if prior step failed
with:
name: Speakeasy Tests (Python ${{ matrix.python-version }})
path: './.speakeasy/reports/tests.xml'
reporter: java-junit