Skip to content

Commit

Permalink
Merge pull request #1 from fedora-infra/workflow
Browse files Browse the repository at this point in the history
Add CI workflow for the project
  • Loading branch information
gridhead authored May 3, 2024
2 parents 368b2b6 + f24e824 commit 6ee71aa
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: firmitas
on: [push, pull_request, workflow_dispatch]
jobs:
ci-basic:
strategy:
fail-fast: false
runs-on: ubuntu-latest
container: fedorapython/fedora-python-tox:latest
steps:
- uses: actions/checkout@v4

- name: Install the base dependencies
run: |
python3 -m pip install --upgrade poetry tox
- name: Check the correctness of the project config
run: |
poetry check
- name: Check the quality of the code
run: |
tox -e cleaning
ci-tests:
strategy:
fail-fast: false
matrix:
tox-env: ["py38", "py39", "py310", "py311", "py312"]
runs-on: ubuntu-latest
container: fedorapython/fedora-python-tox:latest
steps:
- uses: actions/checkout@v4

- name: Install the base dependencies
run: |
python3 -m pip install --upgrade tox
- name: Set up user for running the testcases
run: |
useradd testrunner
chown -R testrunner .
- name: Execute tox
run: |
su testrunner -c "tox -e ${{ matrix.tox-env }}"
env:
FIRMITAS_TEST_USERNAME: "${{ secrets.FIRMITAS_TEST_USERNAME }}"
FIRMITAS_TEST_PASSWORD: "${{ secrets.FIRMITAS_TEST_PASSWORD }}"
FIRMITAS_TEST_REPONAME: "${{ secrets.FIRMITAS_TEST_REPONAME }}"
2 changes: 1 addition & 1 deletion test/test_etoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def locate_config_with_simulate_coming_expiry(daysqant: int = 2000, password: st
id="Invoke notifications with accurate password",
),
pytest.param(
f"--conffile {locate_config_with_simulate_coming_expiry(password="MISTAKEN")}", # noqa : S106
f"--conffile {locate_config_with_simulate_coming_expiry(password='MISTAKEN')}", # noqa : S106
0,
list_etoe_nope(),
id="Invoke notifications with mistaken password",
Expand Down
10 changes: 10 additions & 0 deletions test/test_pagure.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@

from unittest.mock import Mock

import pytest

from firmitas.unit import gopagure


@pytest.mark.parametrize(
"",
[
pytest.param(
id="Exception related to Pagure",
),
]
)
def test_pagure():
gopagure.post = Mock()
gopagure.post.side_effect = Exception()
Expand Down

0 comments on commit 6ee71aa

Please sign in to comment.