Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: maarten-t/pydantic
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: maarten-t/pydantic
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: try-speedup-ci
Choose a head ref
  • 7 commits
  • 2 files changed
  • 1 contributor

Commits on Apr 4, 2022

  1. Copy the full SHA
    7b57f15 View commit details
  2. fix job references

    samuelcolvin committed Apr 4, 2022
    Copy the full SHA
    971d02e View commit details
  3. Copy the full SHA
    2b02438 View commit details
  4. tweak caching

    samuelcolvin committed Apr 4, 2022
    Copy the full SHA
    75fd9cb View commit details
  5. Copy the full SHA
    6c5162e View commit details
  6. Copy the full SHA
    00c50fe View commit details
  7. bump

    samuelcolvin committed Apr 4, 2022
    Copy the full SHA
    85e60b3 View commit details
Showing with 82 additions and 39 deletions.
  1. +81 −38 .github/workflows/ci.yml
  2. +1 −1 .github/workflows/upload-previews.yml
119 changes: 81 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,20 @@ jobs:
with:
python-version: 3.9

- uses: actions/cache@v3
id: cache
with:
path: |
${{ env.pythonLocation }}
.mypy_cache
key: >
lint
${{ runner.os }}
${{ env.pythonLocation }}
${{ hashFiles('tests/requirements-linting.txt') }}
- name: install
if: steps.cache.outputs.cache-hit != 'true'
run: |
make install-linting
pip freeze
@@ -45,9 +58,22 @@ jobs:
- name: set up python
uses: actions/setup-python@v3
with:
python-version: 3.8
python-version: 3.9

- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: >
docs-build
${{ runner.os }}
${{ env.pythonLocation }}
${{ hashFiles('setup.py') }}
${{ hashFiles('requirements.txt') }}
${{ hashFiles('docs/requirements.txt') }}
- name: install
if: steps.cache.outputs.cache-hit != 'true'
run: make install-docs

- name: build site
@@ -59,8 +85,8 @@ jobs:
name: docs
path: site

test-linux:
name: test py${{ matrix.python-version }} on linux
test-linux-compiled:
name: test py${{ matrix.python-version }} on linux compiled
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -78,10 +104,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: >
test-linux-compiled
${{ runner.os }}
${{ env.pythonLocation }}
${{ hashFiles('setup.py') }}
${{ hashFiles('requirements.txt') }}
${{ hashFiles('tests/requirements-testing.txt') }}
- name: install
run: |
make install-testing
pip freeze
run: make install-testing
if: steps.cache.outputs.cache-hit != 'true'

- name: compile
run: |
@@ -92,46 +129,28 @@ jobs:
- run: mkdir coverage

- name: test compiled and deps
run: make test
env:
COVERAGE_FILE: coverage/.coverage.linux-py${{ matrix.python-version }}-cY-dY
CONTEXT: linux-py${{ matrix.python-version }}-compiled-yes-deps-yes

- name: uninstall deps
run: pip uninstall -y cython email-validator devtools python-dotenv

- name: test compiled without deps
run: make test
env:
COVERAGE_FILE: coverage/.coverage.linux-py${{ matrix.python-version }}-cY-dN
CONTEXT: linux-py${{ matrix.python-version }}-compiled-yes-deps-no

- name: remove compiled binaries
run: |
rm -r pydantic/*.so pydantic/*.c pydantic/__pycache__
ls -alh
ls -alh pydantic/
- name: test uncompiled without deps
- name: test
run: make test
env:
COVERAGE_FILE: coverage/.coverage.linux-py${{ matrix.python-version }}-cN-dN
CONTEXT: linux-py${{ matrix.python-version }}-compiled-no-deps-no
COVERAGE_FILE: coverage/.coverage.linux-py${{ matrix.python-version }}-compiled
CONTEXT: linux-py${{ matrix.python-version }}-compiled

- name: store coverage files
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage

test-windows-mac:
test-not-compiled:
name: test py${{ matrix.python-version }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos, windows]
os: [ubuntu, macos, windows]
python-version: ['3.7', '3.8', '3.9', '3.10']
include:
- os: ubuntu

env:
PYTHON: ${{ matrix.python-version }}
OS: ${{ matrix.os }}
@@ -147,16 +166,40 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: >
test-not-compiled
${{ runner.os }}
${{ env.pythonLocation }}
${{ hashFiles('setup.py') }}
${{ hashFiles('requirements.txt') }}
${{ hashFiles('tests/requirements-testing.txt') }}
- name: install
run: make install-testing
if: steps.cache.outputs.cache-hit != 'true'

- run: pip freeze

- run: mkdir coverage

- name: test
- name: test with deps
run: make test
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-with-deps
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-with-deps

- name: uninstall deps
run: pip uninstall -y cython email-validator devtools python-dotenv

- name: test without deps
run: make test
env:
COVERAGE_FILE: coverage/.coverage.${{ matrix.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ matrix.os }}-py${{ matrix.python-version }}
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-without-deps
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-without-deps

- name: store coverage files
uses: actions/upload-artifact@v2
@@ -206,7 +249,7 @@ jobs:
path: coverage

coverage-combine:
needs: [test-linux, test-windows-mac, test-old-mypy]
needs: [test-linux-compiled, test-not-compiled, test-old-mypy]
runs-on: ubuntu-latest

steps:
@@ -224,7 +267,7 @@ jobs:

- run: pip install coverage

- run: ls -la
- run: ls -la coverage
- run: coverage combine coverage
- run: coverage report
- run: coverage html --show-contexts
@@ -257,7 +300,7 @@ jobs:

build:
name: build py3.${{ matrix.python-version }} on ${{ matrix.platform || matrix.os }}
needs: [lint, test-linux, test-windows-mac, test-old-mypy, test-fastapi]
needs: [lint, test-linux-compiled, test-not-compiled, test-old-mypy, test-fastapi]
if: "success() && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')"
strategy:
fail-fast: false
2 changes: 1 addition & 1 deletion .github/workflows/upload-previews.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/setup-python@v3
with:
python-version: '3.8'
python-version: '3.9'

- run: pip install smokeshow