-
Notifications
You must be signed in to change notification settings - Fork 807
Run tests on Windows in Github Actions #531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
71b0ca7
fa44875
c30a911
0041032
0dfcf1c
71cfb28
2a56c1d
9c9a9a6
03dccd9
32ed1da
f1f3535
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 ] | ||
| steps: | ||
| - name: Checkout Contrib Repo @ SHA - ${{ github.sha }} | ||
| uses: actions/checkout@v2 | ||
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please file an issue to track this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please file an issue to track this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 }} | ||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
||
There was a problem hiding this comment.
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.