Skip to content

️BUILD - 2023 PyConIT (pull_request) #130

️BUILD - 2023 PyConIT (pull_request)

️BUILD - 2023 PyConIT (pull_request) #130

name: "2023 PyConIT 🇮🇹 generate gallery.pdf"
run-name: "️BUILD - 2023 PyConIT (${{ github.event_name }})"
on:
pull_request:
push:
branches:
- main
env:
PYTHON_VERSION: 3.11
defaults:
run:
# Use Bash shell with 'errexit' option to exit immediately if any command fails.
shell: bash -el {0}
jobs:
changes:
name: 🔄 Check out changes
runs-on: ubuntu-latest
timeout-minutes: 1
permissions:
pull-requests: read
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
if: github.ref == 'refs/heads/main' # Only checkout when the branch is 'main'
- name: Check for backend file changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 #v3.0.2
id: changes
with:
filters: |
changes:
- "2023_PyConIT/**/*.py"
- "2023_PyConIT/**/*.ipynb"
- "2023_PyConIT/requirements.txt"
lint:
name: 🚨 Lint Python code
if: needs.changes.outputs.changes == 'true'
needs: changes
runs-on: ubuntu-latest
steps:
- name: Setup Python environment
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run:
pip install -r 2023_PyConIT/requirements.txt
- name: Run Black
run:
black 2023_PyConIT --check
- name: Run Flake8
run:
flake8 --config 2023_PyConIT/.flake8 2023_PyConIT
test:
name: 🕵 Test Python code
if: needs.changes.outputs.changes == 'true'
needs: changes
runs-on: ubuntu-latest
steps:
- name: Setup Python environment
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run:
pip install -r 2023_PyConIT/requirements.txt
- name: Run tests
run:
pytest 2023_PyConIT
PyConIT-Generate-pdf:
runs-on: ubuntu-latest
needs: [ lint, test ]
steps:
- name: Setup Python environment
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run:
pip install -r 2023_PyConIT/requirements.txt
- name: Generate PDF
run:
python 2023_PyConIT/src/assemble_plots.py
- name: Archive PDF
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: gallery.pdf
path: 2023_PyConIT/results/gallery.pdf