Complete the code to define a basic GitHub Actions workflow file for Django.
name: Django CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[1]@v3The actions/checkout action is used to check out your repository code so the workflow can access it.
Complete the code to set up Python 3.12 in the GitHub Actions workflow.
- name: Set up Python uses: actions/setup-python@v3 with: python-version: '[1]'
Python 3.12 is the latest stable version and recommended for new Django projects.
Fix the error in the command to install dependencies in the workflow.
- name: Install dependencies
run: pip [1] -r requirements.txtThe correct pip command to install packages from a requirements file is pip install -r requirements.txt.
Fill both blanks to run Django tests and collect static files in the workflow.
- name: Run tests run: python manage.py [1] - name: Collect static files run: python manage.py [2] --noinput
python manage.py test runs tests, and python manage.py collectstatic --noinput collects static files without prompts.
Fill all three blanks to define a job that runs on Ubuntu, sets up Python, and installs dependencies.
jobs:
build:
runs-on: [1]
steps:
- uses: actions/[2]@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '[3]'The job runs on Ubuntu latest, checks out code with actions/checkout, and sets Python 3.12.