diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 53ece2d8..4f2507fe 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -8,7 +8,6 @@ on: jobs: build: - runs-on: ubuntu-latest strategy: max-parallel: 4 @@ -16,15 +15,37 @@ jobs: python-version: [3.7, 3.8, 3.9] steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} + + - name: Cache Python packages + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install Dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt + + - name: Run Django Migrations + run: | + python manage.py migrate + - name: Run Tests run: | python manage.py test + + - name: Check Code Style + run: | + pip install flake8 + flake8 . + python manage.py test