Skip to content

installer added to demo dar-back, installs demo config and backup def… #88

installer added to demo dar-back, installs demo config and backup def…

installer added to demo dar-back, installs demo config and backup def… #88

Workflow file for this run

name: dar-backup.py
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
python3-unit-tests:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# From: https://lannonbr.com/blog/2019-12-09-git-commit-in-actions
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
- name: setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Install required packages
run: sudo apt install -y dar dar-static par2 git python3 python3-venv
- name: Install virtualenv, build and install the dar-backup package
run: |
cd $GITHUB_WORKSPACE/v2
if [[ -d venv ]]; then
rm -fr venv
fi
python3 -m venv venv
. venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install wheel build pytest hatchling hatch
python3 -m build
VERSION=$(cat src/dar_backup/__about__.py |grep -E -o '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+')
echo "Version: $VERSION"
pip3 install --force-reinstall dist/dar_backup-${VERSION}-py3-none-any.whl
- name: Run pytest
run: |
cd $GITHUB_WORKSPACE/v2
export PYTHONPATH=$GITHUB_WORKSPACE/v2
if [[ "$VIRTUAL_ENV" ]]; then
deactivate
fi
if [[ -z "$VIRTUAL_ENV" ]]; then
. venv/bin/activate
fi
pytest tests/