Generate workflow files with a Jinja template (#2687)

* Generate workflow files with a Jinja template

Fixes #2686

* Remove sudo from allowlist_externals

* Update workflows

* Add condition to skip generate-workflows

* Update workflows

* Update .github/workflows/generate_workflows_lib/src/generate_workflows_lib/test.yml.j2

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update .github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update .github/workflows/generate_workflows_lib/src/generate_workflows_lib/lint.yml.j2

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update .github/workflows/generate_workflows_lib/src/generate_workflows_lib/contrib.yml.j2

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>

* Update workflows

* Update workflows

---------

Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
This commit is contained in:
Diego Hurtado
2024-08-06 16:27:38 -06:00
committed by GitHub
parent 2a707bccce
commit f0d8cb39e9
19 changed files with 10051 additions and 284 deletions

35
tox.ini
View File

@ -73,11 +73,8 @@ envlist =
; 1: django~=3.0
; 2: django>=4.0b1,<5.0 backports.zoneinfo==0.2.1
; 3: django>=4.0b1,<5.0
py3{8,9}-test-instrumentation-django-0
py3{8,9}-test-instrumentation-django-1
py3{8,9}-test-instrumentation-django-2
py3{10,11,12}-test-instrumentation-django-1
py3{10,11,12}-test-instrumentation-django-3
py3{8,9}-test-instrumentation-django-{0,1,2}
py3{10,11,12}-test-instrumentation-django-{1,3}
pypy3-test-instrumentation-django-{0,1}
lint-instrumentation-django
@ -109,8 +106,8 @@ envlist =
; 0: falcon ==1.4.1
; 1: falcon >=2.0.0,<3.0.0
; 2: falcon >=3.0.0,<4.0.0
py3{8,9}-test-instrumentation-falcon-0
py3{8,9,10,11,12}-test-instrumentation-falcon-{1,2}
py3{8,9}-test-instrumentation-falcon-{0,1,2}
py3{10,11,12}-test-instrumentation-falcon-{1,2}
pypy3-test-instrumentation-falcon-{0,1,2}
lint-instrumentation-falcon
@ -254,7 +251,6 @@ envlist =
; 0: grpcio==1.62.0
; 1: grpcio==1.63.0
py3{8,9,10,11,12}-test-instrumentation-grpc-{0,1}
pypy3-test-instrumentation-grpc-{0,1}
lint-instrumentation-grpc
; opentelemetry-instrumentation-sqlalchemy
@ -355,7 +351,6 @@ envlist =
; opentelemetry-instrumentation-confluent-kafka
py3{8,9,10,11,12}-test-instrumentation-confluent-kafka
pypy3-test-instrumentation-confluent-kafka
lint-instrumentation-confluent-kafka
; opentelemetry-instrumentation-asyncio
@ -376,8 +371,9 @@ envlist =
spellcheck
docker-tests
docs
generate
generate-workflows
shellcheck
[testenv]
deps =
@ -387,7 +383,8 @@ deps =
; FIXME: add coverage testing
; FIXME: add mypy testing
allowlist_externals = sh
allowlist_externals =
sh
setenv =
; override CORE_REPO_SHA via env variable when testing other branches/commits than main
@ -1318,3 +1315,19 @@ commands =
{toxinidir}/scripts/generate_instrumentation_bootstrap.py
{toxinidir}/scripts/generate_instrumentation_readme.py
{toxinidir}/scripts/generate_instrumentation_metapackage.py
[testenv:generate-workflows]
commands_pre =
pip install {toxinidir}/.github/workflows/generate_workflows_lib
commands =
python {toxinidir}/.github/workflows/generate_workflows.py
[testenv:shellcheck]
commands_pre =
sh -c "sudo apt update -y && sudo apt install --assume-yes shellcheck"
commands =
sh -c "find {toxinidir} -name \*.sh | xargs shellcheck --severity=warning"