This repository has been archived by the owner on May 3, 2024. It is now read-only.
forked from EGCETSII/decide
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: GitHub <[email protected]>
- Loading branch information
Showing
1 changed file
with
55 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 }} | ||