|
| 1 | +name: Test |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + env: |
| 8 | + # We use these variables to convert between tox and GHA version literals |
| 9 | + py34: 3.4 |
| 10 | + py35: 3.5 |
| 11 | + py36: 3.6 |
| 12 | + py37: 3.7 |
| 13 | + py38: 3.8 |
| 14 | + pypy3: pypy3 |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + fail-fast: false # ensures the entire test matrix is run, even if one permutation fails |
| 18 | + matrix: |
| 19 | + python-version: [ py34, py35, py36, py37, py38, pypy3 ] |
| 20 | + package: ["instrumentation", "core", "exporter"] |
| 21 | + os: [ ubuntu-latest ] |
| 22 | + include: |
| 23 | + - python-version: py38 |
| 24 | + package: "tracecontext" |
| 25 | + os: ubuntu-latest |
| 26 | + - python-version: py38 |
| 27 | + package: "mypy" |
| 28 | + os: ubuntu-latest |
| 29 | + - python-version: py38 |
| 30 | + package: "mypyinstalled" |
| 31 | + os: ubuntu-latest |
| 32 | + # py35-instrumentation segfaults on 18.04 so we instead run on 20.04 |
| 33 | + - python-version: py35 |
| 34 | + package: instrumentation |
| 35 | + os: ubuntu-20.04 |
| 36 | + exclude: |
| 37 | + - os: ubuntu-latest |
| 38 | + python-version: py35 |
| 39 | + package: instrumentation |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v2 |
| 42 | + - name: Set up Python ${{ env[matrix.python-version] }} |
| 43 | + uses: actions/setup-python@v2 |
| 44 | + with: |
| 45 | + python-version: ${{ env[matrix.python-version] }} |
| 46 | + - name: Install tox |
| 47 | + run: pip install -U tox-factor |
| 48 | + - name: Cache tox environment |
| 49 | + # Preserves .tox directory between runs for faster installs |
| 50 | + uses: actions/cache@v2 |
| 51 | + with: |
| 52 | + path: .tox |
| 53 | + key: tox-cache-${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }} |
| 54 | + - name: run tox |
| 55 | + run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} |
| 56 | + misc: |
| 57 | + strategy: |
| 58 | + fail-fast: false |
| 59 | + matrix: |
| 60 | + tox-environment: [ "docker-tests", "lint", "docs" ] |
| 61 | + name: ${{ matrix.tox-environment }} |
| 62 | + runs-on: ubuntu-latest |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v2 |
| 65 | + - name: Set up Python 3.8 |
| 66 | + uses: actions/setup-python@v2 |
| 67 | + with: |
| 68 | + python-version: 3.8 |
| 69 | + - name: Install tox |
| 70 | + run: pip install -U tox |
| 71 | + - name: Cache tox environment |
| 72 | + # Preserves .tox directory between runs for faster installs |
| 73 | + uses: actions/cache@v2 |
| 74 | + with: |
| 75 | + path: .tox |
| 76 | + key: tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt') }} |
| 77 | + - name: run tox |
| 78 | + run: tox -e ${{ matrix.tox-environment }} |
0 commit comments