Skip to content

Migrate from Travis CI to GH Actions #1

Migrate from Travis CI to GH Actions

Migrate from Travis CI to GH Actions #1

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- development
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
environment:
name: development
env:
APPLICATION_NAME: pisces
CONTAINER: pisces-web
APPLICATION_PORT: 8007
services:
docker:
image: docker:stable
options: --privileged
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python and cache pip
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Copy config file
run: cp ${{ env.APPLICATION_NAME }}/config.py.example ${{ env.APPLICATION_NAME }}/config.py
- name: Login to Docker
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Start Docker containers
run: docker compose up -d
- name: Wait for services to be ready
run: ./wait-for-it.sh $CONTAINER:$APPLICATION_PORT -- echo "$CONTAINER is ready"
- name: Install pre-commit
run: |
pip install "pre-commit===2.13.0"
pre-commit install
- name: Run pre-commit checks
run: pre-commit run --all-files --show-diff-on-failure
- name: Run tests
run: docker compose exec -T $CONTAINER python manage.py test