mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-26 03:24:01 +03:00
Speed up CI tests on macOS (#3480)
This commit is contained in:
parent
c35779782c
commit
2186caf11d
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -60,6 +60,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
python-version: "3.9"
|
python-version: "3.9"
|
||||||
cache: pip
|
cache: pip
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r requirements.txt
|
||||||
- name: Docker ${{ matrix.script.name }}
|
- name: Docker ${{ matrix.script.name }}
|
||||||
run: sh tests/test_docker.sh ${{ matrix.script.args }}
|
run: sh tests/test_docker.sh ${{ matrix.script.args }}
|
||||||
|
|
||||||
|
@ -99,6 +101,8 @@ jobs:
|
||||||
python-version: "3.9"
|
python-version: "3.9"
|
||||||
cache: pip
|
cache: pip
|
||||||
cache-dependency-path: '**/requirements*.txt'
|
cache-dependency-path: '**/requirements*.txt'
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pip install -r requirements.txt
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
node-version: "16"
|
||||||
|
|
|
@ -6,13 +6,6 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# Install modern pip with new resolver:
|
|
||||||
# https://blog.python.org/2020/11/pip-20-3-release-new-resolver.html
|
|
||||||
pip install 'pip>=20.3'
|
|
||||||
|
|
||||||
# install test requirements
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
# create a cache directory
|
# create a cache directory
|
||||||
mkdir -p .cache/bare
|
mkdir -p .cache/bare
|
||||||
cd .cache/bare
|
cd .cache/bare
|
||||||
|
|
|
@ -14,7 +14,11 @@ from cookiecutter.exceptions import FailedHookException
|
||||||
|
|
||||||
PATTERN = r"{{(\s?cookiecutter)[.](.*?)}}"
|
PATTERN = r"{{(\s?cookiecutter)[.](.*?)}}"
|
||||||
RE_OBJ = re.compile(PATTERN)
|
RE_OBJ = re.compile(PATTERN)
|
||||||
IS_WINDOWS = sys.platform.startswith("win")
|
|
||||||
|
if sys.platform.startswith("win"):
|
||||||
|
pytest.skip("sh doesn't support windows", allow_module_level=True)
|
||||||
|
elif sys.platform.startswith("darwin") and os.getenv("CI"):
|
||||||
|
pytest.skip("skipping slow macOS tests on CI", allow_module_level=True)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
@ -157,7 +161,6 @@ def test_project_generation(cookies, context, context_override):
|
||||||
check_paths(paths)
|
check_paths(paths)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(IS_WINDOWS, reason="sh doesn't support windows")
|
|
||||||
@pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id)
|
@pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id)
|
||||||
def test_flake8_passes(cookies, context_override):
|
def test_flake8_passes(cookies, context_override):
|
||||||
"""Generated project should pass flake8."""
|
"""Generated project should pass flake8."""
|
||||||
|
@ -169,7 +172,6 @@ def test_flake8_passes(cookies, context_override):
|
||||||
pytest.fail(e.stdout.decode())
|
pytest.fail(e.stdout.decode())
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(IS_WINDOWS, reason="sh doesn't support windows")
|
|
||||||
@pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id)
|
@pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id)
|
||||||
def test_black_passes(cookies, context_override):
|
def test_black_passes(cookies, context_override):
|
||||||
"""Generated project should pass black."""
|
"""Generated project should pass black."""
|
||||||
|
|
|
@ -6,9 +6,6 @@
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# install test requirements
|
|
||||||
pip install -r requirements.txt
|
|
||||||
|
|
||||||
# create a cache directory
|
# create a cache directory
|
||||||
mkdir -p .cache/docker
|
mkdir -p .cache/docker
|
||||||
cd .cache/docker
|
cd .cache/docker
|
||||||
|
|
Loading…
Reference in New Issue
Block a user