Merge branch 'delete_users_view' of github.com:Solvosoft/organilab in… #1134
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
name: Run Tests | |
on: push | |
# needs set development as default | |
jobs: | |
python: | |
runs-on: ubuntu-latest | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgres | |
# Provide the password for postgres | |
env: | |
POSTGRES_PASSWORD: 0rg4n1l4b | |
POSTGRES_USER: organilab_user | |
POSTGRES_DB: organilab | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
# Maps tcp port 5432 on service container to the host | |
- 5432:5432 | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
env: | |
PYTHON_VERSION: ${{matrix.python-version}} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{matrix.python-version}} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{matrix.python-version}} | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install -r test_requirements.txt | |
- name: Test with tox | |
run: tox | |
env: | |
TOXENV: py${{matrix.python-version}} | |
- name: Coverage Badge | |
uses: tj-actions/coverage-badge-py@v2 | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@v17 | |
id: verify-changed-files | |
with: | |
files: coverage.svg | |
- name: Change to pg_pages | |
if: ${{ (steps.verify-changed-files.outputs.files_changed == 'true') && (github.ref == 'refs/heads/master') }} | |
run: git fetch origin gh-pages && mv coverage.svg coveragebk.svg && git checkout gh-pages && mv coveragebk.svg coverage.svg | |
- name: Commit files | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add coverage.svg | |
git commit --allow-empty -m "Updated coverage.svg" | |
- name: Push changes on gh-pages | |
if: ${{ (steps.verify-changed-files.outputs.files_changed == 'true') && (github.ref == 'refs/heads/master') }} | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.github_token }} | |
branch: gh-pages | |
- name: Push changes on local branch | |
if: ${{ (steps.verify-changed-files.outputs.files_changed == 'true') && (github.ref != 'refs/heads/master') }} | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.github_token }} | |
branch: ${{ github.ref }} | |