forked from strands-agents/sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (89 loc) · 2.4 KB
/
test-lint.yml
File metadata and controls
94 lines (89 loc) · 2.4 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
name: Test and Lint
on:
workflow_call:
inputs:
ref:
required: true
type: string
jobs:
unit-test:
name: Unit Tests - Python ${{ matrix.python-version }} - ${{ matrix.os-name }}
permissions:
contents: read
strategy:
matrix:
include:
# Linux
- os: ubuntu-latest
os-name: 'linux'
python-version: "3.10"
- os: ubuntu-latest
os-name: 'linux'
python-version: "3.11"
- os: ubuntu-latest
os-name: 'linux'
python-version: "3.12"
- os: ubuntu-latest
os-name: 'linux'
python-version: "3.13"
# Windows
- os: windows-latest
os-name: 'windows'
python-version: "3.10"
- os: windows-latest
os-name: 'windows'
python-version: "3.11"
- os: windows-latest
os-name: 'windows'
python-version: "3.12"
- os: windows-latest
os-name: 'windows'
python-version: "3.13"
# MacOS - latest only; not enough runners for macOS
- os: macos-latest
os-name: 'macOS'
python-version: "3.13"
fail-fast: true
runs-on: ${{ matrix.os }}
env:
LOG_LEVEL: DEBUG
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }} # Explicitly define which commit to check out
persist-credentials: false # Don't persist credentials for subsequent actions
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --no-cache-dir hatch
- name: Run Unit tests
id: tests
run: hatch test tests --cover
continue-on-error: false
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ inputs.ref }}
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
pip install --no-cache-dir hatch
- name: Run lint
id: lint
run: hatch run test-lint
continue-on-error: false