diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index a3a7d77..930fe48 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,20 +10,31 @@ on: jobs: python_format: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 container: - image: rootproject/root:6.26.00-ubuntu20.04 + image: rootproject/root:6.32.00-ubuntu24.04 options: --user 0 # run as root steps: + - uses: actions/checkout@v3 + - name: apt update run: apt-get -y update - name: Install missing software - run: apt-get install -y git python3-pip && pip install black==24.4.2 + run: apt-get install -y git python3-pip python3-venv - - uses: actions/checkout@v2 + - name: Create venv + shell: bash + run: | + cd $GITHUB_WORKSPACE + python3 -m venv venv + source venv/bin/activate + pip install black==24.4.2 - name: Check Python formatting shell: bash - run: cd $GITHUB_WORKSPACE && bash scripts/python-formatting.sh + run: | + cd $GITHUB_WORKSPACE + source venv/bin/activate + bash scripts/python-formatting.sh diff --git a/scripts/python-formatting.sh b/scripts/python-formatting.sh index 5aa1169..286f35d 100644 --- a/scripts/python-formatting.sh +++ b/scripts/python-formatting.sh @@ -2,7 +2,7 @@ FOUND_ISSUE=0 -for FILENAME in $(find . -path ./law -prune -o -name "*.py"); do +for FILENAME in $(find . \( -path ./venv -o -path ./law \) -prune -o -name "*.py"); do # only run the check if the filename ends with .py if [[ ${FILENAME} == *.py ]]; then echo "Checking ${FILENAME}"