Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
ci(gh-actions): initial refactor
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
ferferga authored Dec 14, 2023
1 parent ec3d6ff commit 016df64
Showing 1 changed file with 55 additions and 31 deletions.
86 changes: 55 additions & 31 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
name: Python application
name: Decide checks 🗳️

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on:
pull_request:
paths-ignore:
- "**/*.md"
workflow_dispatch:
push:
branches:
- develop
- master
pull_request:
workflow_dispatch:
paths-ignore:
- "**/*.md"

jobs:
build:
test:
name: Test 🧪
runs-on: ubuntu-latest
defaults:
run:
working-directory: decide
strategy:
matrix:
pyversion: ['3.8','3.9']

runs-on: ubuntu-latest
module:
- "authentication"
- "base"
- "booth"
- "census"
- "decide"
- "gateway"
- "mixnet"
- "postproc"
- "store"
- "visualizer"
- "voting"
- "test-scripts"

services:
postgres:
image: postgres:11.18-bullseye
image: postgres:latest
env:
POSTGRES_USER: decide
POSTGRES_PASSWORD: decide
Expand All @@ -29,31 +51,33 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{matrix.pyversion}}
uses: actions/setup-python@v4
- name: Checkout ⬇️
uses: actions/[email protected]
with:
show-progress: false

- name: Setup Python 🐍
uses: actions/[email protected]
with:
python-version: ${{matrix.pyversion}}
- name: psycopg2 prerequisites
run: sudo apt-get install libpq-dev
- name: Install dependencies and config
python-version: '3.x'
check-latest: true

- name: Install dependencies 📦
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install codacy-coverage
cp decide/local_settings.gactions.py decide/local_settings.py
- name: Run migrations (unnecessary)
sudo apt update
sudo apt install libpq-dev chromium-browser chromium-chromedriver
echo "pynose==1.4.8" >> ../requirements.txt
echo "selenium" >> ../requirements.txt
echo "coverage" >> ../requirements.txt
echo "setuptools" >> ../requirements.txt
pip install -r ../requirements.txt
cp local_settings.gactions.py local_settings.py
- name: Perform migrations 🗃️
run: |
cd decide
python manage.py migrate
- name: Run tests
- name: Run unit tests 🔬
run: |
cd decide
coverage run --branch --source=. ./manage.py test --keepdb
coverage xml
- name: Codacy Coverage Reporter
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: decide/coverage.xml
python manage.py test ${{ matrix.module }}

0 comments on commit 016df64

Please sign in to comment.