-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (81 loc) · 2.49 KB
/
2023-PyData_Berlin-python-pdf-workflow.yaml
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
name: "2023 PyData Berlin 🇩🇪 generate gallery.pdf"
run-name: "️2023 PyData Berlin 🇩🇪 (${{ github.sha }})"
on:
pull_request:
paths:
- "2023_PyData_Berlin/**/*.py"
- "2023_PyData_Berlin/**/*.ipynb"
branches:
- main
push:
paths:
- "2023_PyData_Berlin/**/*.py"
- "2023_PyData_Berlin/**/*.ipynb"
branches:
- main
workflow_dispatch:
env:
PYTHON_VERSION: 3.11
defaults:
run:
shell: bash -el {0}
jobs:
lint:
name: 🚨 Lint Python code
runs-on: ubuntu-latest
steps:
- name: Setup Python environment
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 1
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run:
pip install -r 2023_PyData_Berlin/requirements.txt
- name: Run Black
run:
black 2023_PyData_Berlin --check
- name: Run Flake8
run:
flake8 --config 2023_PyData_Berlin/.flake8 2023_PyData_Berlin
test:
name: 🕵 Test Python code
runs-on: ubuntu-latest
steps:
- name: Setup Python environment
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run:
pip install -r 2023_PyData_Berlin/requirements.txt
- name: Run tests
run:
pytest 2023_PyData_Berlin
generate-pdf:
runs-on: ubuntu-latest
needs: [ lint, test ]
steps:
- name: Setup Python environment
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run:
pip install -r 2023_PyData_Berlin/requirements.txt
- name: Generate PDF
run:
python 2023_PyData_Berlin/src/assemble_plots.py
- name: Archive PDF
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
with:
name: gallery.pdf
path: 2023_PyData_Berlin/results/gallery.pdf