Skip to content

Commit

Permalink
finally block (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelboulton committed Aug 5, 2023
1 parent 7c030f0 commit a405cb3
Show file tree
Hide file tree
Showing 24 changed files with 496 additions and 227 deletions.
53 changes: 48 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

- uses: pre-commit/action@v3.0.0

test:
unit-tests:
runs-on: ubuntu-latest
needs: simple-checks

Expand All @@ -38,6 +38,49 @@ jobs:
- TOXENV: py3
TOXCFG: tox.ini

env:
TOXENV: ${{ matrix.TOXENV }}
TOXCFG: ${{ matrix.TOXCFG }}

steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3
env:
cache-name: cache-${{ matrix.TOXENV }}
with:
path: .tox
key: ${{ runner.os }}-tox-${{ env.cache-name }}-${{ hashFiles('pyproject.toml', 'requirements.in') }}

- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml', 'requirements.in') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: install deps
run: |
pip install tox -c constraints.txt
- name: tox
run: |
tox -c ${TOXCFG} -e ${TOXENV}
integration-tests:
runs-on: ubuntu-latest
needs: unit-tests

strategy:
fail-fast: false
matrix:
include:
# integration tests
- TOXENV: py3-generic
TOXCFG: tox-integration.ini
- TOXENV: py3-mqtt
Expand All @@ -56,14 +99,17 @@ jobs:
TOXCFG: ${{ matrix.TOXCFG }}

steps:
- uses: jpribyl/action-docker-layer-caching@v0.1.1
continue-on-error: true

- uses: actions/checkout@v3

- uses: actions/cache@v3
env:
cache-name: cache-${{ matrix.TOXENV }}
with:
path: .tox
key: ${{ runner.os }}-tox-${{ env.cache-name }}-${{ hashFiles('tox.ini', 'tox-integration.ini', 'pyproject.toml', 'requirements.in') }}
key: ${{ runner.os }}-tox-${{ env.cache-name }}-${{ hashFiles('pyproject.toml', 'requirements.in') }}

- uses: actions/cache@v3
with:
Expand All @@ -72,9 +118,6 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- uses: jpribyl/action-docker-layer-caching@v0.1.1
continue-on-error: true

- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 1 addition & 3 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ bump2version==1.0.1
cachetools==5.3.1
# via tox
certifi==2023.7.22
# via
# requests
# tavern (pyproject.toml)
# via requests
cffi==1.15.1
# via cryptography
cfgv==3.3.1
Expand Down

0 comments on commit a405cb3

Please sign in to comment.