Skip to content

Commit c2e8444

Browse files
Setup github actions test
1 parent dab32e8 commit c2e8444

File tree

3 files changed

+43
-3
lines changed

3 files changed

+43
-3
lines changed

.github/workflows/tests.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ]
11+
12+
name: Python ${{ matrix.python-version }}
13+
steps:
14+
15+
- uses: actions/checkout@v2
16+
17+
- name: Setup timezone
18+
uses: zcong1993/setup-timezone@master
19+
with:
20+
timezone: UTC
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
28+
- name: Install Python dependencies
29+
run: |
30+
python3 -m pip install --upgrade pip
31+
pip3 install -r requirements.txt
32+
pip3 install -e .
33+
34+
- name: Test with pytest
35+
run: |
36+
pytest
37+
38+
- name: Check coverage
39+
run: |
40+
pytest --cov=cli --cov=pythonanywhere --cov=scripts --cov-fail-under=65

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/pythonanywhere/helper_scripts.svg?branch=master)](https://travis-ci.org/pythonanywhere/helper_scripts)
1+
![Build Status](https://github.com/pythonanywhere/helper_scripts/actions/workflows/tests.yaml/badge.svg)
22
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
33
[![PyPI](https://img.shields.io/pypi/v/pythonanywhere)](https://pypi.org/project/pythonanywhere/)
44
[![Downloads](https://pepy.tech/badge/pythonanywhere)](https://pepy.tech/project/pythonanywhere)

tests/test_django_project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def test_actually_produces_wsgi_file_that_can_import_project_non_nested(
476476
running_python_version = ".".join(python_version().split(".")[:2])
477477
project = DjangoProject("mydomain.com", running_python_version)
478478
shutil.copytree(str(non_nested_submodule), str(project.project_path))
479-
if running_python_version in ["3.7", "3.8"]:
479+
if running_python_version in ["3.7", "3.8", "3.9", "3.10"]:
480480
project.create_virtualenv(django_version="latest")
481481
else:
482482
project.create_virtualenv()
@@ -496,7 +496,7 @@ def test_actually_produces_wsgi_file_that_can_import_nested_project(
496496
running_python_version = ".".join(python_version().split(".")[:2])
497497
project = DjangoProject("mydomain.com", running_python_version)
498498
shutil.copytree(str(more_nested_submodule), str(project.project_path))
499-
if running_python_version in ["3.7", "3.8"]:
499+
if running_python_version in ["3.7", "3.8", "3.9", "3.10"]:
500500
project.create_virtualenv(django_version="latest")
501501
else:
502502
project.create_virtualenv()

0 commit comments

Comments
 (0)