|
77 | 77 | name: code-coverage
|
78 | 78 | path: coverage/.coverage.py*
|
79 | 79 |
|
| 80 | + min-deps-test: |
| 81 | + # Attempt to run the TOX-ENV tests for the given OS and python |
| 82 | + # VERSION with the minimal possible Basilisp dependencies |
| 83 | + # versions. |
| 84 | + # |
| 85 | + # For dependencies to be elligible for minimum version testing, |
| 86 | + # they should be declared in `pyproject.toml` as such in the |
| 87 | + # following format |
| 88 | + # |
| 89 | + # <dependency-name> = "^..." |
| 90 | + # <dependency-name> = ">=..." |
| 91 | + # <dependency-name> = { version = "^..." ... |
| 92 | + # <dependency-name> = { version = ">=..." ... |
| 93 | + runs-on: ${{matrix.os}} |
| 94 | + strategy: |
| 95 | + matrix: |
| 96 | + os: [ubuntu-latest] |
| 97 | + version: ['3.8'] |
| 98 | + tox-env: ['py38'] |
| 99 | + steps: |
| 100 | + - uses: actions/checkout@v3 |
| 101 | + - uses: actions/setup-python@v4 |
| 102 | + with: |
| 103 | + python-version: ${{ matrix.version }} |
| 104 | + - name: Cache dependencies |
| 105 | + id: cache-deps |
| 106 | + uses: actions/cache@v3 |
| 107 | + with: |
| 108 | + path: | |
| 109 | + .tox |
| 110 | + ~/.cache/pip |
| 111 | + ~/.cache/pypoetry |
| 112 | + ~/.local/share/pypoetry |
| 113 | + key: mdt-${{ runner.os }}-python-${{ matrix.version }}-poetry-${{ hashFiles('pyproject.toml', 'tox.ini') }} |
| 114 | + - name: Install Poetry |
| 115 | + if: steps.cache-deps.outputs.cache-hit != 'true' |
| 116 | + run: curl -sSL https://install.python-poetry.org | python3 - |
| 117 | + - name: Install Tox |
| 118 | + run: | |
| 119 | + pip install -U pip |
| 120 | + pip install tox |
| 121 | + - name: Run minimum deps test |
| 122 | + env: |
| 123 | + TOX_PARALLEL_NO_SPINNER: 1 |
| 124 | + TOX_SHOW_OUTPUT: "True" |
| 125 | + TOXENV: ${{ matrix.tox-env }} |
| 126 | + run: | |
| 127 | + poetry lock |
| 128 | + DEPENDENCY_REGEX="$(poetry show -T --without=dev | awk '{print $1}' | paste -s -d '|' -)" |
| 129 | + [[ -z "$DEPENDENCY_REGEX" ]] && { echo "Error: can't source dependencies" ; exit 1; } |
| 130 | + echo ::deps $DEPENDENCY_REGEX |
| 131 | + sed -i -E 's/('$DEPENDENCY_REGEX')( = )(|\{ version = )"(\^|>=)([0-9])/\1\2\3"==\5/' pyproject.toml |
| 132 | + git diff |
| 133 | + tox run-parallel -p 2 |
| 134 | +
|
80 | 135 | report-coverage:
|
81 | 136 | runs-on: ubuntu-latest
|
82 | 137 | needs: run-tests
|
|
0 commit comments