Skip to content

A feature-rich command-line audio/video downloader

[ci] Improve workflow checks (#14316)

bashonlyae3923b6b23b
diff --git a/.github/workflows/test-workflows.yml b/.github/workflows/test-workflows.yml
index 36ff86e48d..c07e01d7af 100644
--- a/.github/workflows/test-workflows.yml
+++ b/.github/workflows/test-workflows.yml
@@ -3,12 +3,14 @@ on:
push:
paths:
- .github/workflows/*
+ - bundle/docker/linux/*.sh
- devscripts/setup_variables.py
- devscripts/setup_variables_tests.py
- devscripts/utils.py
pull_request:
paths:
- .github/workflows/*
+ - bundle/docker/linux/*.sh
- devscripts/setup_variables.py
- devscripts/setup_variables_tests.py
- devscripts/utils.py
@@ -32,6 +34,7 @@ jobs:
env:
ACTIONLINT_TARBALL: ${{ format('actionlint_{0}_linux_amd64.tar.gz', env.ACTIONLINT_VERSION) }}
run: |
+ python -m devscripts.install_deps -o --include test
sudo apt -y install shellcheck
python -m pip install -U pyflakes
curl -LO "${ACTIONLINT_REPO}/releases/download/v${ACTIONLINT_VERSION}/${ACTIONLINT_TARBALL}"
@@ -41,6 +44,9 @@ jobs:
- name: Run actionlint
run: |
./actionlint -color
+ - name: Check Docker shell scripts
+ run: |
+ shellcheck bundle/docker/linux/*.sh
- name: Test GHA devscripts
run: |
- python -m devscripts.setup_variables_tests
+ pytest -Werror --tb=short devscripts/setup_variables_tests.py
diff --git a/bundle/docker/linux/build.sh b/bundle/docker/linux/build.sh
index b278ebf60f..71adaad058 100755
--- a/bundle/docker/linux/build.sh
+++ b/bundle/docker/linux/build.sh
@@ -24,6 +24,7 @@ if [[ -z "${EXCLUDE_CURL_CFFI:-}" ]]; then
fi
runpy -m venv /yt-dlp-build-venv
+# shellcheck disable=SC1091
source /yt-dlp-build-venv/bin/activate
# Inside the venv we use venvpy instead of runpy
venvpy -m ensurepip --upgrade --default-pip
diff --git a/devscripts/setup_variables_tests.py b/devscripts/setup_variables_tests.py
index 8cb52daa1f..42abba9d1f 100644
--- a/devscripts/setup_variables_tests.py
+++ b/devscripts/setup_variables_tests.py
@@ -1,4 +1,3 @@
-# Allow direct execution
import os
import sys
@@ -55,7 +54,7 @@ def _test(github_repository, note, repo_vars, repo_secrets, inputs, expected=Non
assert result == exp, f'unexpected result: {github_repository} {note}'
-def main():
+def test_setup_variables():
DEFAULT_VERSION_WITH_REVISION = dt.datetime.now(tz=dt.timezone.utc).strftime('%Y.%m.%d.%H%M%S')
DEFAULT_VERSION = calculate_version()
BASE_REPO_VARS = {
@@ -323,9 +322,3 @@ def main():
'pypi_project': None,
'pypi_suffix': None,
}, ignore_revision=True)
-
- print('all tests passed')
-
-
-if __name__ == '__main__':
- main()