|
1 |
| -name: Test |
| 1 | +name: Core Repo Tests |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches-ignore:
|
6 | 6 | - 'release/*'
|
7 | 7 | pull_request:
|
8 | 8 | env:
|
9 |
| - CONTRIB_REPO_SHA: 5c9e043d6921550d82668788e3758a733fb11cb8 |
| 9 | + # Set variable to 'master' if your change will not affect Contrib. |
| 10 | + # Otherwise, set variable to the commit of your branch on |
| 11 | + # opentelemetry-python-contrib which is compatible with these Core repo |
| 12 | + # changes. |
| 13 | + CONTRIB_REPO_SHA: master |
10 | 14 |
|
11 | 15 | jobs:
|
12 | 16 | build:
|
|
62 | 66 | uses: actions/cache@v2
|
63 | 67 | with:
|
64 | 68 | path: .tox
|
65 |
| - key: tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }} |
| 69 | + key: tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core |
66 | 70 | - name: run tox
|
67 | 71 | run: tox -f ${{ matrix.python-version }}-${{ matrix.package }}
|
68 | 72 | misc:
|
|
92 | 96 | uses: actions/cache@v2
|
93 | 97 | with:
|
94 | 98 | path: .tox
|
95 |
| - key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }} |
| 99 | + key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-core |
| 100 | + - name: run tox |
| 101 | + run: tox -e ${{ matrix.tox-environment }} |
| 102 | + contrib-build: |
| 103 | + env: |
| 104 | + # We use these variables to convert between tox and GHA version literals |
| 105 | + py35: 3.5 |
| 106 | + py36: 3.6 |
| 107 | + py37: 3.7 |
| 108 | + py38: 3.8 |
| 109 | + pypy3: pypy3 |
| 110 | + runs-on: ${{ matrix.os }} |
| 111 | + strategy: |
| 112 | + fail-fast: false # ensures the entire test matrix is run, even if one permutation fails |
| 113 | + matrix: |
| 114 | + python-version: [ py35, py36, py37, py38, pypy3 ] |
| 115 | + package: ["instrumentation", "exporter"] |
| 116 | + os: [ ubuntu-latest ] |
| 117 | + include: |
| 118 | + # py35-instrumentation segfaults on 18.04 so we instead run on 20.04 |
| 119 | + - python-version: py35 |
| 120 | + package: instrumentation |
| 121 | + os: ubuntu-20.04 |
| 122 | + exclude: |
| 123 | + - os: ubuntu-latest |
| 124 | + python-version: py35 |
| 125 | + package: instrumentation |
| 126 | + steps: |
| 127 | + - name: Checkout Contrib Repo @ SHA - ${{ env.CONTRIB_REPO_SHA }} |
| 128 | + uses: actions/checkout@v2 |
| 129 | + with: |
| 130 | + repository: open-telemetry/opentelemetry-python-contrib |
| 131 | + ref: ${{ env.CONTRIB_REPO_SHA }} |
| 132 | + - name: Checkout Core Repo @ SHA ${{ github.sha }} |
| 133 | + uses: actions/checkout@v2 |
| 134 | + with: |
| 135 | + repository: open-telemetry/opentelemetry-python |
| 136 | + path: opentelemetry-python-core |
| 137 | + - name: Set up Python ${{ env[matrix.python-version] }} |
| 138 | + uses: actions/setup-python@v2 |
| 139 | + with: |
| 140 | + python-version: ${{ env[matrix.python-version] }} |
| 141 | + - name: Install tox |
| 142 | + run: pip install -U tox-factor |
| 143 | + - name: Cache tox environment |
| 144 | + # Preserves .tox directory between runs for faster installs |
| 145 | + uses: actions/cache@v2 |
| 146 | + with: |
| 147 | + path: .tox |
| 148 | + key: tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-contrib |
| 149 | + - name: run tox |
| 150 | + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} |
| 151 | + contrib-misc: |
| 152 | + strategy: |
| 153 | + fail-fast: false |
| 154 | + matrix: |
| 155 | + tox-environment: [ "docker-tests"] |
| 156 | + name: ${{ matrix.tox-environment }} |
| 157 | + runs-on: ubuntu-latest |
| 158 | + steps: |
| 159 | + - name: Checkout Contrib Repo @ SHA - ${{ env.CONTRIB_REPO_SHA }} |
| 160 | + uses: actions/checkout@v2 |
| 161 | + with: |
| 162 | + repository: open-telemetry/opentelemetry-python-contrib |
| 163 | + ref: ${{ env.CONTRIB_REPO_SHA }} |
| 164 | + - name: Checkout Core Repo @ SHA ${{ github.sha }} |
| 165 | + uses: actions/checkout@v2 |
| 166 | + with: |
| 167 | + repository: open-telemetry/opentelemetry-python |
| 168 | + path: opentelemetry-python-core |
| 169 | + - name: Set up Python 3.8 |
| 170 | + uses: actions/setup-python@v2 |
| 171 | + with: |
| 172 | + python-version: 3.8 |
| 173 | + - name: Install tox |
| 174 | + run: pip install -U tox |
| 175 | + - name: Cache tox environment |
| 176 | + # Preserves .tox directory between runs for faster installs |
| 177 | + uses: actions/cache@v2 |
| 178 | + with: |
| 179 | + path: .tox |
| 180 | + key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }}-contrib |
96 | 181 | - name: run tox
|
97 | 182 | run: tox -e ${{ matrix.tox-environment }}
|
0 commit comments