Skip to content

Commit

Permalink
Add contrib provider ce-oem GitHub workflows (Infra) (#938)
Browse files Browse the repository at this point in the history
* Remove old ce-oem workflow

This workflow comes from the original Git repository and is no longer
needed.

* Add workflow for the ce-oem provider

This workflow is adapted from existing workflows used for the generic
providers.

* Update contrib ce-oem tox config

- Point to the correct version of Python using {envpython}
- Remove the "develop installation" step for the ce-oem provider
- Convert the test step into a test coverage one to generate an XML
report to be used later by Codecov

* Point to the right directory for generic providers

* Install ce-oem provider prior to run validation on it

* Add codecov config for ce-oem contrib provider

Following Codecov documentation on flags[1], use the
`contrib-provider-ce-oem` flag defined in the GitHub workflow[2] to mark
Codecov status checks as non-blocking[3].

[1] https://docs.codecov.com/docs/flags
[2] .github/workflows/tox-contrib-provider-ce-oem.yaml
[3]
https://docs.codecov.com/docs/common-recipe-list#set-non-blocking-status-checks

* Fix tox configuration for ce-oem provider

* Add coverage requirement to ce-oem tox config

* Add coverage config to ce-oem provider

* Update codecov config to make project status non-blocking for ce-oem provider

* Change job id and add a name to it for easier reference
  • Loading branch information
pieqq authored Jan 24, 2024
1 parent 37e6276 commit 727e004
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 48 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/tox-contrib-provider-ce-oem.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Test provider-ce-oem (from contrib area) with tox

on:
push:
branches: [ main ]
paths:
- contrib/checkbox-provider-ce-oem/**
pull_request:
branches: [ main ]
paths:
- contrib/checkbox-provider-ce-oem/**
workflow_dispatch:

jobs:
tox_test_contrib_ce_oem_provider:
name: Test ce-oem provider (from contrib area) with tox
defaults:
run:
working-directory: contrib/checkbox-provider-ce-oem
runs-on: ubuntu-20.04
strategy:
matrix:
python: ["3.5", "3.6", "3.8", "3.10"]
include:
- python: "3.5"
tox_env_name: "py35"
- python: "3.6"
tox_env_name: "py36"
- python: "3.8"
tox_env_name: "py38"
- python: "3.10"
tox_env_name: "py310"
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: pip install tox
- name: Run tox
run: tox -e${{ matrix.tox_env_name }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: contrib-provider-ce-oem
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@ flag_management:
# carryforward means if a test was not run again, use the previous
# coverage result for the current flag (part)
carryforward: true
individual_flags:
# non-blocking status check for ce-oem provider in contrib area
- name: contrib-provider-ce-oem
paths:
- contrib/checkbox-provider-ce-oem
carryforward: true
statuses:
- type: patch
informational: true
- type: project
informational: true
35 changes: 0 additions & 35 deletions contrib/.github/workflows/tox.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions contrib/checkbox-provider-ce-oem/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
branch = True
source = bin,manage
omit =
tests/*

[report]
exclude_lines =
@abc.abstractmethod
@abc.abstractproperty
@abstractmethod
@abstractproperty
@public
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
show_missing = True
32 changes: 19 additions & 13 deletions contrib/checkbox-provider-ce-oem/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,29 @@ skipsdist=True
[testenv]
allowlist_externals = rm
commands =
pip -q install ../../checkbox-ng
{envpython} -m pip -q install ../../checkbox-ng
# Required because this provider depends on checkbox-support parsers & scripts
pip -q install ../../checkbox-support
{envpython} -m pip -q install ../../checkbox-support
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-resource.provider
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-base.provider
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-certification-client.provider
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-certification-server.provider
rm -f /var/tmp/checkbox-providers-develop/checkbox-provider-ce-oem.provider
# Install all providers in develop mode to make sure everything works fine
{envbindir}/python3 ../resource/manage.py develop
{envbindir}/python3 ../base/manage.py develop
{envbindir}/python3 ../certification-client/manage.py develop
{envbindir}/python3 ../certification-server/manage.py develop
{envbindir}/python3 manage.py develop
{envbindir}/python3 manage.py validate
{envbindir}/python3 manage.py test
{envpython} ../../providers/resource/manage.py develop
{envpython} ../../providers/base/manage.py develop
{envpython} ../../providers/certification-client/manage.py develop
{envpython} ../../providers/certification-server/manage.py develop
{envpython} manage.py develop
{envpython} manage.py validate
{envpython} -m coverage run manage.py test
{envpython} -m coverage report
{envpython} -m coverage xml

[testenv:py3.5]
[testenv:py35]
deps =
flake8
coverage == 5.5
pyserial
natsort == 4.0.3
requests == 2.9.1
Expand All @@ -42,9 +45,10 @@ setenv=
# but it breaks some old python3.5 builds
SETUPTOOLS_SCM_PRETEND_VERSION=0.0

[testenv:py3.6]
[testenv:py36]
deps =
flake8
coverage == 5.5
pyserial
natsort == 4.0.3
requests == 2.18.4
Expand All @@ -57,9 +61,10 @@ deps =
distro == 1.0.1
PyYAML == 3.12

[testenv:py3.8]
[testenv:py38]
deps =
flake8
coverage == 7.3.0
pep8-naming
pyserial
natsort == 7.0.1
Expand All @@ -73,9 +78,10 @@ deps =
distro == 1.4.0
PyYAML == 5.3.1

[testenv:py3.10]
[testenv:py310]
deps =
flake8
coverage == 7.3.0
pep8-naming
pyserial
natsort == 8.0.2
Expand Down

0 comments on commit 727e004

Please sign in to comment.