Skip to content

Commit

Permalink
chore[ci]: Added Github action for regular testing package
Browse files Browse the repository at this point in the history
* Added CI job for testing python-iniparse on latest
  Fedoras and CentOS 10. Tests are triggered on PR
  request and should be triggered every week on Monday
  morning
* Added script for installing required packages
* Also dded configuration for dependabot
  • Loading branch information
jirihnidek committed Dec 16, 2024
1 parent 0f3da0a commit c6b5d6f
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "main"
commit-message:
prefix: "ci"
44 changes: 44 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: pytest

on:
pull_request:
workflow_dispatch:
schedule:
# at 5:00 every 1st of the month
- cron: 0 5 1 * *

jobs:
pytest:
name: "pytest"

permissions:
issues: write
pull-requests: write

strategy:
fail-fast: false
matrix:
include:
- name: "CentOS Stream 10"
image: "quay.io/centos/centos:stream10"
- name: "Fedora latest"
image: "fedora:latest"
- name: "Fedora Rawhide"
image: "fedora:rawhide"

runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}

steps:
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Run container-pre-test.sh"
run: |
bash scripts/container-pre-test.sh
- name: "Run pytest"
env:
PYTEST_ADDOPTS: "--color=yes --code-highlight=yes --showlocals"
run: python3 -m pytest ${{ matrix.pytest_args }}
10 changes: 10 additions & 0 deletions scripts/container-pre-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

source /etc/os-release
# This repository is required for python3-pytest and python3-test
# on Centos Stream
if [[ $ID == "centos" ]]; then
dnf config-manager --enable crb
fi

dnf install -y python3-setuptools python3-pip python3-devel python3-pytest python3-test

0 comments on commit c6b5d6f

Please sign in to comment.