Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
py37: 3.7
py38: 3.8
py39: 3.9
pypy3: pypy3
pypy3: pypy-3.7
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [ py36, py37, py38, py39, pypy3 ]
package: ["instrumentation", "exporter", "sdkextension", "propagator"]
os: [ ubuntu-latest ]
os: [ ubuntu-20.04, windows-2019 ]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't auto-upgrade to avoid surprises.

steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2
Expand All @@ -38,28 +38,36 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ env[matrix.python-version] }}
- name: Install tox
run: pip install -U tox-factor
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
architecture: 'x64' # some packages such as cryptography do not publish pre-built wheels for x86
- name: Cache python/tox
uses: actions/cache@v2
with:
path: |
.tox
~/.cache/pip
key: v4-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
c:\users\runneradmin\appdata\local\pip\cache
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
- name: Install tox and pip
run: pip install -U tox-factor pip
# tox fails on windows and Python3.6 when tox dir is reused between builds so we remove it
- name: fix for windows + py3.6
if: ${{ matrix.os == 'windows-2019' && matrix.python-version == 'py36' }}
shell: pwsh
run: Remove-Item .\.tox\ -Force -Recurse -ErrorAction Ignore
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
- name: Find and merge benchmarks
# TODO: fix and enable on windows
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please file an issue to track this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# TODO: Add at least one benchmark to every package type to remove this (#249)
if: matrix.package == 'sdkextension'
if: ${{ matrix.package == 'sdkextension' && matrix.os != 'windows-2019' }}
run: >-
jq -s '.[0].benchmarks = ([.[].benchmarks] | add)
| if .[0].benchmarks == null then null else .[0] end'
**/**/tests/*${{ matrix.package }}*-benchmark.json > output.json
- name: Report on benchmark results
# TODO: fix and enable on windows
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please file an issue to track this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# TODO: Add at least one benchmark to every package type to remove this (#249)
if: matrix.package == 'sdkextension'
if: ${{ matrix.package == 'sdkextension' && matrix.os != 'windows-2019' }}
uses: rhysd/github-action-benchmark@v1
with:
name: OpenTelemetry Python Benchmarks - Python ${{ env[matrix.python-version ]}} - ${{ matrix.package }}
Expand All @@ -80,7 +88,7 @@ jobs:
matrix:
tox-environment: [ "docker-tests", "lint", "docs", "generate" ]
name: ${{ matrix.tox-environment }}
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2
Expand All @@ -94,6 +102,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: 'x64'
- name: Install tox
run: pip install -U tox
- name: Install libsnappy-dev
Expand All @@ -106,7 +115,7 @@ jobs:
path: |
.tox
~/.cache/pip
key: v4-misc-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt', 'gen-requirements.txt', 'docs-requirements.txt') }}
key: v6-misc-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt', 'gen-requirements.txt', 'docs-requirements.txt') }}
- name: run tox
run: tox -e ${{ matrix.tox-environment }}
- name: Ensure generated code is up to date
Expand Down