Skip to content

Nano Automation

Nano Automation #846

Workflow file for this run

name: Run Unit Tests
on:
pull_request:
types: [opened, synchronize, reopened, edited, ready_for_review]
workflow_dispatch:
workflow_call:
secrets:
PYKLATCHAT_TESTING_CREDENTIALS_V2:
description: 'testing data'
required: true
SERVER_ENV:
description: 'running environment'
required: true
jobs:
unit_tests:
runs-on: ubuntu-latest
env:
PYKLATCHAT_TESTING_CREDENTIALS: ${{ secrets.PYKLATCHAT_TESTING_CREDENTIALS_V2 }}
KLAT_ENV: ${{ secrets.SERVER_ENV }}
steps:
- uses: actions/checkout@v4
- name: echo Testing Creds
run: echo $PYKLATCHAT_TESTING_CREDENTIALS
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/requirements.txt
pip install -r requirements/test_requirements.txt
pip install -r requirements/legacy_migration_requirements.txt
- name: Get Credential
run: |
mkdir -p ~/.local/share/neon
echo $PYKLATCHAT_TESTING_CREDENTIALS > ~/.local/share/neon/credentials.json
- name: Test DB Utils
run: |
pytest tests/test_db_utils.py --doctest-modules --junitxml=tests/db-utils-test-results.xml
- name: Upload DB Utils test results
uses: actions/upload-artifact@v4
with:
name: db-utils-test-results
path: tests/db-utils-test-results.xml
- name: Test SIO
run: |
pytest chat_server/tests/test_sio.py --doctest-modules --junitxml=tests/sio-test-results.xml
- name: Upload SIO test results
uses: actions/upload-artifact@v4
with:
name: sio-test-results
path: tests/sio-test-results.xml
build_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Setuptools
run: |
python -m pip install -U pip setuptools
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Build Distribution Packages
run: |
python setup.py bdist_wheel
- name: Install JS Beautifier
run: |
python -m pip install jsbeautifier==1.15.1
- name: Build Nano JS
working-directory: ./
run: python ./scripts/file_merger.py --working_dir ./chat_client/static --weighted_dirs 1=['js'] --weighted_files 0=['nano_builder.js'] --skip_files meta.js klatchatNano.js --save_to ./js/klatchatNano.js --beautify 1
- name: Build Nano CSS
working-directory: ./
run: python ./scripts/file_merger.py --working_dir ./chat_client/static --weighted_dirs 1=['css'] --skip_files sidebar.css klatchatNano.css --save_to ./css/klatchatNano.css --beautify 0