-
Notifications
You must be signed in to change notification settings - Fork 20
111 lines (93 loc) · 2.66 KB
/
ci-build.yaml
File metadata and controls
111 lines (93 loc) · 2.66 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
102
103
104
105
106
107
108
109
110
111
name: CI Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
pre-commit-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
pip-${{ runner.os }}-
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run pre-commit
run: pre-commit run --verbose --all-files
security-test:
runs-on: ubuntu-latest
container: python:3.12-slim
steps:
- uses: actions/checkout@v4
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
pip-${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -e ".[dev]"
- name: Security Checks
run: bandit --severity-level high .
pytests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Julia packages
uses: actions/cache@v3
with:
path: |
~/.julia
key: julia-packages-${{ runner.os }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
julia-packages-${{ runner.os }}-
- name: Install Julia 1.12
uses: julia-actions/setup-julia@v1
with:
version: '1.12'
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
pip-${{ runner.os }}-
- name: Create virtualenv
run: |
python -m venv .venv
source .venv/bin/activate
- name: Install Python dependencies
run: |
source .venv/bin/activate
python -m pip install --upgrade pip wheel
pip install -e ".[test]"
- name: Run Julia setup (PowerModels)
env:
JULIA_PKG_SERVER: ""
run: |
source .venv/bin/activate
gridfm_datakit setup_pm
- name: Unit tests
run: |
source .venv/bin/activate
export SKIP_LARGE_GRIDS=1
pytest --cov=. tests/ -v -s