From 69810b8f9fe34a76b9a41cceee17dc51ebf9b095 Mon Sep 17 00:00:00 2001 From: Diego Hurtado Date: Wed, 24 Jul 2024 11:12:16 -0600 Subject: [PATCH] Rename to generate-workflows --- .github/workflows/contrib_0.yml | 30 +++++++++++++++++++++++++++++- .github/workflows/lint_0.yml | 2 +- .github/workflows/misc_0.yml | 23 ++++++++++++++++++++++- .github/workflows/test_0.yml | 2 +- .github/workflows/test_1.yml | 2 +- tox.ini | 5 +++-- 6 files changed, 57 insertions(+), 7 deletions(-) diff --git a/.github/workflows/contrib_0.yml b/.github/workflows/contrib_0.yml index 9673414d2f3..d9a796667c1 100644 --- a/.github/workflows/contrib_0.yml +++ b/.github/workflows/contrib_0.yml @@ -1,5 +1,5 @@ # Do not edit this file. -# This file is generated automatically by executing tox -e generate_workflows +# This file is generated automatically by executing tox -e generate-workflows name: Contrib 0 @@ -659,6 +659,34 @@ jobs: - name: Run tests run: tox -e py38-test-instrumentation-fastapi -- -ra + py38-test-instrumentation-fastapi-slim: + name: instrumentation-fastapi-slim + runs-on: ubuntu-latest + steps: + - name: Checkout contrib repo @ SHA - ${{ env.CONTRIB_REPO_SHA }} + uses: actions/checkout@v4 + with: + repository: open-telemetry/opentelemetry-python-contrib + ref: ${{ env.CONTRIB_REPO_SHA }} + + - name: Checkout core repo @ SHA - ${{ github.sha }} + uses: actions/checkout@v4 + with: + repository: open-telemetry/opentelemetry-python + path: opentelemetry-python-core + + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: "3.8" + architecture: "x64" + + - name: Install tox + run: pip install tox + + - name: Run tests + run: tox -e py38-test-instrumentation-fastapi-slim -- -ra + py38-test-instrumentation-flask-0: name: instrumentation-flask-0 runs-on: ubuntu-latest diff --git a/.github/workflows/lint_0.yml b/.github/workflows/lint_0.yml index ec21e8e5ada..db927fcfabe 100644 --- a/.github/workflows/lint_0.yml +++ b/.github/workflows/lint_0.yml @@ -1,5 +1,5 @@ # Do not edit this file. -# This file is generated automatically by executing tox -e generate_workflows +# This file is generated automatically by executing tox -e generate-workflows name: Lint 0 diff --git a/.github/workflows/misc_0.yml b/.github/workflows/misc_0.yml index 08c382f13db..1dd8bc4d13d 100644 --- a/.github/workflows/misc_0.yml +++ b/.github/workflows/misc_0.yml @@ -1,5 +1,5 @@ # Do not edit this file. -# This file is generated automatically by executing tox -e generate_workflows +# This file is generated automatically by executing tox -e generate-workflows name: Misc 0 @@ -176,3 +176,24 @@ jobs: - name: Run tests run: tox -e shellcheck -- -ra + + generate-workflows: + name: generate-workflows + runs-on: ubuntu-latest + steps: + - name: Checkout repo @ SHA - ${{ github.sha }} + uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install tox + run: pip install tox + + - name: Run tests + run: tox -e generate-workflows -- -ra + + - name: Check workflows are up to date + run: git diff --exit-code || (echo 'Generated workflows are out of date, run "tox -e generate-workflows" and commit the changes in this PR.' && exit 1) diff --git a/.github/workflows/test_0.yml b/.github/workflows/test_0.yml index ca27740aa87..7cf3ebc733b 100644 --- a/.github/workflows/test_0.yml +++ b/.github/workflows/test_0.yml @@ -1,5 +1,5 @@ # Do not edit this file. -# This file is generated automatically by executing tox -e generate_workflows +# This file is generated automatically by executing tox -e generate-workflows name: Test 0 diff --git a/.github/workflows/test_1.yml b/.github/workflows/test_1.yml index e34d42e2117..174af5f10ba 100644 --- a/.github/workflows/test_1.yml +++ b/.github/workflows/test_1.yml @@ -1,5 +1,5 @@ # Do not edit this file. -# This file is generated automatically by executing tox -e generate_workflows +# This file is generated automatically by executing tox -e generate-workflows name: Test 1 diff --git a/tox.ini b/tox.ini index 3e10a704ba4..dea048b6448 100644 --- a/tox.ini +++ b/tox.ini @@ -109,6 +109,7 @@ envlist = docker-tests-proto{3,4} public-symbols-check shellcheck + generate-workflows [testenv] deps = @@ -126,7 +127,7 @@ setenv = ; override CONTRIB_REPO_SHA via env variable when testing other branches/commits than main ; i.e: CONTRIB_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e ; CONTRIB_REPO_SHA={env:CONTRIB_REPO_SHA:main} - CONTRIB_REPO_SHA=22912ef68ff72f75f1126ab2f39b8237b47bae92 + CONTRIB_REPO_SHA=c1dab5d39a36f1257aae7c9425b23ec672272966 CONTRIB_REPO=git+https://github.com/open-telemetry/opentelemetry-python-contrib.git@{env:CONTRIB_REPO_SHA} mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/:{toxinidir}/tests/opentelemetry-test-utils/src/ @@ -428,7 +429,7 @@ deps = commands = python {toxinidir}/scripts/public_symbols_checker.py -[testenv:generate_workflows] +[testenv:generate-workflows] commands_pre = pip install -e {env:CONTRIB_REPO}\#egg=generate_workflows_lib&subdirectory=.github/workflows/generate_workflows_lib