Skip to content

Commit

Permalink
CI updates
Browse files Browse the repository at this point in the history
Update GitHub CI to use PDM
Remove GitLab CI configuration since I haven't been keeping it updated
  • Loading branch information
smsearcy committed Jun 6, 2024
1 parent 05008f7 commit a70e076
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 206 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: ci

on: [push]

env:
PYTHON_VERSION: '3.9'

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Run pre-commit
uses: pre-commit/[email protected]

mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
sudo apt-get install -y librrd-dev
pdm sync -G mypy
- name: Run mypy
run: |
pdm run mypy meshinfo tests
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: meshmap
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get install -y librrd-dev
pdm sync -G testing
- name: Run pytest
run: |
pdm run pytest --cov=meshinfo
env:
MESHMAP_COLLECTOR_DATA_DIR: "."
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: meshmap

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
sudo apt-get install -y librrd-dev
pdm sync -G docs
- name: Run Sphinx
run: pdm run sphinx-build -W --keep-going -b html docs docs/_build/html
90 changes: 0 additions & 90 deletions .github/workflows/tests.yml

This file was deleted.

53 changes: 31 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -18,11 +14,12 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -52,7 +49,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
pytestdebug.log
cover/

# Translations
*.mo
Expand All @@ -73,9 +70,9 @@ instance/

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -86,7 +83,9 @@ profile_default/
ipython_config.py

# pyenv
.python-version
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -96,9 +95,23 @@ ipython_config.py
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
Expand All @@ -110,14 +123,12 @@ celerybeat.pid

# Environments
.env
.env/
.venv/
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
pythonenv*

# Spyder project settings
.spyderproject
Expand All @@ -140,14 +151,12 @@ dmypy.json
# pytype static type analyzer
.pytype/

# operating system-related files
# file properties cache/storage on macOS
*.DS_Store
# thumbnail cache on Windows
Thumbs.db

# profiling data
.prof

# Cython debug symbols
cython_debug/

# End of https://www.toptal.com/developers/gitignore/api/python
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
93 changes: 0 additions & 93 deletions .gitlab-ci.yml

This file was deleted.

1 change: 0 additions & 1 deletion .pdm-python

This file was deleted.

0 comments on commit a70e076

Please sign in to comment.