-
Notifications
You must be signed in to change notification settings - Fork 134
64 lines (61 loc) · 1.49 KB
/
python-test.yml
File metadata and controls
64 lines (61 loc) · 1.49 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
name: Python test
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
permissions:
actions: read
security-events: write
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
OS: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Set up Python venv
run: |
uv venv
shell: bash
- name: Special dependencies for macos
if: matrix.os == 'macos-latest'
run: |
source .venv/bin/activate
brew install hdf5
brew install cbc
uv pip install numpy==2.0.0
uv pip install tables==3.10.2
uv pip install pulp==3.0.2
uv run pulptest
- name: Install EMHASS with test dependencies
run: |
uv sync --reinstall --extra test
- name: Test with pytest
run: |
uv run pytest
scan-pr:
needs:
- build
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v2.0.1"
with:
fail-on-vuln: false
scan-args: |-
--recursive
./
permissions:
security-events: write
contents: read
actions: read