Skip to content

Modify tests to trigger GitHub Actions #9

Modify tests to trigger GitHub Actions

Modify tests to trigger GitHub Actions #9

name: Django Test Suite on PR
on:
pull_request:
branches:
- feature/add-github-actions # Trigger workflow on PRs to this branch
jobs:
run-tests:
runs-on: ubuntu-latest
services:
docker:
image: docker:19.03.12
options: --privileged
ports:
- 5432:5432
steps:
# Check out the merged code (default behavior for pull_request events)
- name: Check out merged code
uses: actions/checkout@v2
# Install Docker Compose
- name: Set up Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Build the Docker environment
- name: Build the Docker environment
run: docker-compose -f local.yml build
# Run the test suite
- name: Run test suite
env:
DJANGO_ENV: test # Example environment variable
run: docker-compose -f local.yml run --rm django bash ./init.sh
# Cleanup Docker resources
- name: Cleanup
run: docker-compose -f local.yml down --volumes