Skip to content

Commit 919f300

Browse files
committed
Restore ci-cd
1 parent 116c912 commit 919f300

8 files changed

Lines changed: 3307 additions & 558 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 24 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on: push
55

66
env:
77
PROJECT_ROOT: ${{ github.workspace }}
8+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
89

910
jobs:
1011
tests:
@@ -14,98 +15,70 @@ jobs:
1415
strategy:
1516
fail-fast: false
1617
matrix:
17-
os: ["ubuntu-latest", "macos-latest", "windows-latest", "windows-2019"]
18+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
1819
python-version: ["3.9", "3.10", "3.11"]
1920

20-
exclude:
21-
# Due to nbconvert TypeError
22-
- os: windows-latest
23-
python-version: "3.7"
24-
# Due to nbconvert TypeError
25-
- os: windows-2019
26-
python-version: "3.7"
27-
2821
steps:
29-
- uses: "actions/checkout@v3"
30-
- uses: "actions/setup-python@v4"
22+
- uses: "actions/checkout@v4"
23+
- uses: "actions/setup-python@v5"
3124
with:
3225
python-version: "${{ matrix.python-version }}"
3326
- name: "Install package dependencies"
3427
run: |
3528
python -VV
36-
python -m site
3729
python -m pip install --upgrade pip setuptools wheel
38-
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
39-
python -m pip install -r requirements.txt
40-
python -m pip install .
41-
- name: "Run package tests for ${{ matrix.python-version }}, ${{ matrix.os }}"
42-
run: "python -m pytest -vv -m 'not latex and not notebook'"
30+
python -m pip install -r requirements-py${{ matrix.python-version }}.txt
31+
python -m pip install --upgrade pytest nbformat flake8
32+
python -m pip install -e .
4333
- name: "Run notebook tests for ${{ matrix.python-version }} if ubuntu os"
4434
run: |
4535
echo "${{ matrix.os }}"
46-
sudo apt-get install graphviz
4736
python -m pytest -vv -m notebook
4837
if: matrix.os == 'ubuntu-latest'
4938
- name: "Run notebook tests for ${{ matrix.python-version }} if mac os"
5039
run: |
5140
echo "${{ matrix.os }}"
52-
brew install graphviz
5341
python -m pytest -vv -m notebook
5442
if: matrix.os == 'macos-latest'
5543
- name: "Run notebook tests for ${{ matrix.python-version }} if windows os"
5644
run: |
5745
echo "${{ matrix.os }}"
58-
choco install graphviz
5946
python -m pytest -vv -m notebook
6047
if: matrix.os == 'windows-latest'
61-
- name: "Run latex tests for ${{ matrix.python-version }} if ubuntu os"
62-
run: |
63-
echo "${{ matrix.os }}"
64-
sudo apt-get install texlive-latex-extra
65-
python -m pytest -vv -m latex
66-
if: matrix.os == 'ubuntu-latest'
67-
6848
deliver:
6949
runs-on: ubuntu-latest
7050
needs: tests
7151
steps:
7252
- name: Checkout repository
73-
uses: actions/checkout@v2
74-
- uses: "actions/checkout@v2"
75-
- uses: "actions/setup-python@v2"
53+
uses: actions/checkout@v4
54+
- name: Setup Python
55+
uses: actions/setup-python@v5
7656
with:
77-
python-version: "${{ matrix.python-version }}"
78-
- name: "Install dependencies for latex and marp slide delivery"
57+
python-version: "3.11"
58+
- name: "Install Python dependencies"
7959
run: |
80-
sudo apt-get install texlive-latex-extra
81-
npm install -g @marp-team/marp-cli
8260
python -VV
83-
python -m site
84-
python -m pip install .
85-
61+
python -m pip install --upgrade pip setuptools wheel
62+
python -m pip install -r requirements-py3.11.txt
63+
python -m pip install -e .
64+
- name: "Install marp"
65+
run: npm install -g @marp-team/marp-cli
8666
- name: "Create slides"
8767
run: |
88-
mkdir -p tex_out
89-
90-
# python risk_learning/tex.py --filepath ${{ github.workspace }}/slides/intro/ai-risk-and-discrete-geometry.tex --outdir ${{ github.workspace }}/tex_out
91-
marp --html 'slides/intro/intro' -o "${{ github.workspace }}/tex_out/intro.pdf"--allow-local-files
92-
python risk_learning/tex.py --filepath ${{ github.workspace }}/slides/discrete-geometry/discrete-geometry.tex --outdir ${{ github.workspace }}/tex_out
93-
python risk_learning/tex.py --filepath ${{ github.workspace }}/slides/correlation-causality/correlation-causality.tex --outdir ${{ github.workspace }}/tex_out
94-
python risk_learning/tex.py --filepath ${{ github.workspace }}/slides/adversarial-regularization-regimes/adversarial.tex --outdir ${{ github.workspace }}/tex_out
95-
96-
cd tex_out
97-
ls -al
68+
mkdir -p slides_out
69+
marp --html 'slides/intro/intro.md' -o "${{ github.workspace }}/slides_out/intro.pdf" --allow-local-files
70+
marp --html 'slides/high-risk-ai/high-risk-ai.md' -o "${{ github.workspace }}/slides_out/high-risk-ai.pdf" --allow-local-files
71+
ls -al slides_out
9872
- name: "Archive slide artifacts"
99-
uses: actions/upload-artifact@v3
73+
uses: actions/upload-artifact@v4
10074
with:
10175
name: risk-ai-slides
102-
path: ${{ github.workspace }}/tex_out/*.pdf
103-
76+
path: ${{ github.workspace }}/slides_out/*.pdf
10477
- name: Release
10578
uses: softprops/action-gh-release@v1
10679
if: startsWith(github.ref, 'refs/tags/')
10780
env:
10881
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10982
with:
11083
files: |
111-
${{ github.workspace }}/tex_out/*.pdf
84+
${{ github.workspace }}/slides_out/*.pdf

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ readme = "README.md"
66
authors = [
77
{ name = "Paul Larsen", email = "munichpavel@gmail.com" }
88
]
9-
requires-python = ">=3.12"
9+
requires-python = ">=3.9,<=3.13"
1010
dependencies = [
1111
"ipywidgets>=8.1.8",
1212
"jupyterlab>=4.5.7",
13-
"matplotlib>=3.10.9",
14-
"pandas>=3.0.3",
15-
"polars>=1.40.1",
16-
"scikit-learn>=1.8.0",
13+
"matplotlib>=3.9.4",
14+
"pandas>=2.3.3",
15+
"polars>=1.36.1",
16+
"scikit-learn>=1.6.1",
1717
]
1818

1919

@@ -28,5 +28,5 @@ exclude-newer = "7 days"
2828
dev = [
2929
"flake8>=7.3.0",
3030
"nbformat>=5.10.4",
31-
"pytest>=9.0.3",
31+
"pytest>=8.4.2",
3232
]

0 commit comments

Comments
 (0)