feat: use python 3.12 in github actions #65
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install tld beautifulsoup4 | |
- name: Test with unittest | |
run: | | |
python -m unittest discover test | |
test_without_dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3 | |
- name: Test with unittest | |
run: | | |
python -m unittest discover test | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3 | |
- name: Install coverage | |
run: | | |
python -m pip install coverage httpie tld beautifulsoup4 | |
- name: Run coverage | |
run: | | |
python -m coverage run -m unittest discover test | |
coverage report -m | |
coverage json | |
jq '.totals.percent_covered' coverage.json > coverage.txt | |
cat coverage.txt | |
bandit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3 | |
- name: Install bandit | |
run: | | |
python -m pip install bandit | |
- name: Run bandit scan | |
run: | | |
bandit -r . | |
black: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3 | |
- name: Install black | |
run: | | |
python -m pip install black | |
- name: Run black | |
run: | | |
black --check . |