Skip to content

Update dependency axios to v1.15.2 [SECURITY] #716

Update dependency axios to v1.15.2 [SECURITY]

Update dependency axios to v1.15.2 [SECURITY] #716

Workflow file for this run

name: Django Tests
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
workflow_dispatch: # allow manual trigger
concurrency:
group: django-tests-${{ github.ref }}
cancel-in-progress: true
permissions:
pull-requests: write
contents: write
jobs:
test:
runs-on: [self-hosted] # uses your self-hosted runner pool
services:
mariadb:
image: mariadb:11.8
env:
MARIADB_ROOT_PASSWORD: itsASecretToEveryone
MARIADB_DATABASE: cohiva
MARIADB_USER: cohiva
MARIADB_PASSWORD: cohiva_password
ports:
- 127.0.0.1:3306:3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=3
redis:
image: redis:latest
ports:
- 127.0.0.1:6379:6379
steps:
- uses: kacus/github-action-container-cleanup@v1.0.1
- name: Checkout
uses: actions/checkout@v6
- name: Execute init-script on MariaDB
run: |
docker exec -i $(docker ps -qf "ancestor=mariadb:11.8") \
mariadb -u root -p$MARIADB_ROOT_PASSWORD < ${{ github.workspace }}/django/scripts/mariadb/init_test.sql
env:
MARIADB_ROOT_PASSWORD: itsASecretToEveryone
- name: Load GnuCash demo data required for tests
run: |
docker exec -i $(docker ps -qf "ancestor=mariadb:11.8") \
mariadb -u root -p$MARIADB_ROOT_PASSWORD cohiva_gnucash_test < ${{ github.workspace }}/django/demo-data/demo-data-gnucash.sql
env:
MARIADB_ROOT_PASSWORD: itsASecretToEveryone
- name: Initialize submodules
run: git submodule update --init --recursive
- name: Build test image
run: |
cd django && \
docker build . \
--build-arg GIT_TAG=${{ github.ref_name }} \
--build-arg GIT_COMMIT=${{ github.sha }} \
--target cohiva-platform-django \
-t cohiva:test
- name: Prepare for coverage report
run: |
set -e
cd django
touch .coverage
ln -sf website_example website
- name: Run Django tests
run: |
set -e
cd django
docker run --rm \
--network host \
-e GITHUB_ACTIONS=true \
-e COVERAGE=true \
-v ./.coverage:/cohiva/.coverage_output_for_github_action \
-v ./htmlcov:/cohiva/htmlcov \
cohiva:test \
sh -c "cp /cohiva/cohiva/base_config_for_tests.py /cohiva/cohiva/base_config.py && /cohiva/setup.py --use-default-certs && /cohiva/run-tests.sh"
exit $?
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
COVERAGE_PATH: django
GITHUB_TOKEN: ${{ github.token }}
ANNOTATE_MISSING_LINES: true
- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v7
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
name: python-coverage-comment-action
# If you use a different name, update COMMENT_FILENAME accordingly
path: python-coverage-comment-action.txt