Add Python 3.12 to CI #1552
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- "master" | |
- "release/*" | |
pull_request: | |
branches: | |
- "master" | |
- "release/*" | |
name: Python CI | |
jobs: | |
py_build: | |
name: Build Python Bindings for Python ${{ matrix.python-version }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install requirements | |
run: | | |
sudo apt-get update | |
sudo apt-get install libgtk-3-dev | |
sudo apt-get install libgirepository1.0-dev | |
sudo apt-get install xvfb | |
sudo apt-get install libdbus-1-dev libaudit-dev libauparse-dev | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: 1.66.1 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv==2023.7.4 || pip install pipenv | |
pipenv install --dev --keep-outdated --python ${{ matrix.python-version }} | |
- name: Build | |
id: build | |
run: | | |
pipenv run compile_catalog | |
pipenv run python setup.py bdist_wheel | |
echo ::set-output name=virt_env::$(pipenv --venv) | |
ui_format_check: | |
name: UI formatter check | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Format check with black | |
uses: psf/black@stable | |
with: | |
options: "--check --diff -t py39" | |
src: "./fapolicy_analyzer" | |
version: "~= 22.0" | |
ui_lint: | |
name: UI Lint | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
id: install_deps | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 flake8-i18n | |
- name: Lint with flake8 | |
run: python -m flake8 ./fapolicy_analyzer | |
ui_test: | |
name: UI Test Suite for Python ${{ matrix.python-version }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install requirements | |
run: | | |
sudo apt-get update | |
sudo apt-get install libgtk-3-dev | |
sudo apt-get install libgirepository1.0-dev | |
sudo apt-get install xvfb | |
sudo apt-get install libgtksourceview-3.0-dev | |
sudo apt-get install gir1.2-webkit2-4.0 | |
sudo apt-get install libdbus-1-dev libaudit-dev libauparse-dev | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install extra locales | |
id: install_locales | |
run: | | |
sudo apt-get -y install locales | |
sudo locale-gen es_ES.UTF-8 | |
- name: Install dependencies | |
id: install_deps | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv==2023.7.4 || pip install pipenv | |
pipenv install --dev --python ${{ matrix.python-version }} | |
echo ::set-output name=virt_env::$(pipenv --venv) | |
- name: Setup Bindings | |
run: pipenv run python setup.py develop | |
- name: Test with pytest | |
run: pipenv run test |