diff options
author | Thibault Saunier <tsaunier@igalia.com> | 2022-08-31 14:15:16 -0400 |
---|---|---|
committer | Thibault Saunier <tsaunier@igalia.com> | 2023-04-22 09:32:32 -0400 |
commit | b14e675a2786c31aa614ed23591fbed03d05a946 (patch) | |
tree | 734669cdb6c63a3fbe7ab27f796e044d47665094 /ci | |
parent | d4a910649955ecbee2db1ced67eed748995f6d58 (diff) | |
download | gstreamer-b14e675a2786c31aa614ed23591fbed03d05a946.tar.gz |
gir: Checkout all .gir files and check that they are updated on the CI
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3010>
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/scripts/check-diff.py | 30 | ||||
-rwxr-xr-x | ci/scripts/check-documentation-diff.py | 20 |
2 files changed, 30 insertions, 20 deletions
diff --git a/ci/scripts/check-diff.py b/ci/scripts/check-diff.py new file mode 100755 index 0000000000..e0b9d71031 --- /dev/null +++ b/ci/scripts/check-diff.py @@ -0,0 +1,30 @@ +#!/usr/bin/python3 +import os +import subprocess +import sys +import argparse + +PARSER = argparse.ArgumentParser() +PARSER.add_argument('name', default="documentation cache", nargs="?") + +if __name__ == "__main__": + opts = PARSER.parse_args() + + print(opts) + diffsdir = 'diffs' + os.makedirs(diffsdir, exist_ok=True) + res = 0 + try: + subprocess.check_call(['git', 'diff', '--quiet']) + except subprocess.CalledProcessError: + diffname = os.path.join(diffsdir, f"{opts.name.replace(' ', '_')}.diff") + res += 1 + with open(diffname, 'w') as diff: + subprocess.check_call(['git', 'diff'], stdout=diff) + print(f'\033[91mYou have a diff in the {opts.name}. Please update with:\033[0m') + print(' $ curl %s/%s | git apply -' % + (os.environ.get('CI_ARTIFACTS_URL', "NOT_RUNNING_ON_CI"), diffname.replace('../', ''))) + + if res != 0: + print('(note that it might take a few minutes for artefacts to be available on the server)\n') + sys.exit(res) diff --git a/ci/scripts/check-documentation-diff.py b/ci/scripts/check-documentation-diff.py deleted file mode 100755 index 7dad06e7cc..0000000000 --- a/ci/scripts/check-documentation-diff.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/python3 -import os, subprocess, sys - -if __name__ == "__main__": - diffsdir = 'plugins-cache-diffs' - os.makedirs(diffsdir, exist_ok=True) - res = 0 - try: - subprocess.check_call(['git', 'diff', '--quiet'] ) - except subprocess.CalledProcessError: - diffname = os.path.join(diffsdir, 'plugins_cache.diff') - res += 1 - with open(diffname, 'w') as diff: - subprocess.check_call(['git', 'diff'], stdout=diff) - print('\033[91mYou have a diff in the documentation cache. Please update with:\033[0m') - print(' $ curl %s/%s | git apply -' % (os.environ['CI_ARTIFACTS_URL'], diffname.replace('../', ''))) - - if res != 0: - print('(note that it might take a few minutes for artefacts to be available on the server)\n') - sys.exit(res)
\ No newline at end of file |