Files
jj e294de2859 downloads: use prepared chromium base archives (#2668)
instead of downloading deps per-platform we will have pre-prepared
tarballs for the base + tooling for each platform
2026-10-14 11:46:40 +02:00

151 lines
4.6 KiB
YAML

name: Code Validation
on:
pull_request:
push:
branches:
- '**'
tags-ignore:
- '**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
code-check:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up CI environment
uses: ./.github/actions/ci-setup
- name: Format utils
run: python -m yapf --style .style.yapf -e '*/third_party/*' -rpd utils
- name: Lint utils
run: ./devutils/run_utils_pylint.py --hide-fixme
- name: Test utils
run: ./devutils/run_utils_tests.sh
- name: Format devutils
run: python -m yapf --style .style.yapf -e '*/third_party/*' -rpd devutils
- name: Lint devutils
run: ./devutils/run_devutils_pylint.py --hide-fixme
- name: Test devutils
run: ./devutils/run_devutils_tests.sh
validate-config:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up CI environment
uses: ./.github/actions/ci-setup
- name: Validate repository configuration
run: ./devutils/validate_config.py
validate-with-source:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up CI environment
uses: ./.github/actions/ci-setup
- name: Restore Chromium download cache
uses: actions/cache@v5
with:
path: chromium_download_cache
key: ${{ runner.os }}-chromium-download-cache-${{ hashFiles('chromium_version.txt', 'downloads.ini', 'deps.ini') }}
- name: Retrieve Chromium source archive
run: |
rm -rf chromium_src
mkdir -p chromium_download_cache
./utils/downloads.py retrieve -i deps.ini -c chromium_download_cache &
DEPS_PID=$!
if ! ./utils/downloads.py retrieve -i downloads.ini -c chromium_download_cache; then
TARBALL="chromium_download_cache/chromium-$(cat chromium_version.txt)-base.tar.zst"
if [[ $(tar --test-label -f "$TARBALL" 2> /dev/null) == "clone" ]]; then
echo "INFO: Using cached clone tarball"
else
./utils/clone.py -o src
mv src chromium_src
echo "INFO: Pruning directories for clone tarball"
find chromium_src -type d -name '.git' -exec rm -rf "{}" \; -prune
echo "INFO: Creating clone tarball"
tar --transform "s/chromium_src/chromium-$(cat chromium_version.txt)/" \
--label=clone -cf - chromium_src | zstd -T0 --fast - > "$TARBALL"
fi
fi
wait "$DEPS_PID"
- name: Unpack Chromium source archive
run: |
if [ ! -d chromium_src ]; then
./utils/downloads.py unpack -i downloads.ini -c chromium_download_cache chromium_src
fi
./utils/downloads.py unpack -i deps.ini -c chromium_download_cache chromium_src
- name: Validate patches
run: ./devutils/validate_patches.py -l chromium_src -v
- name: Restore generated source file lists
id: source-file-lists-cache
uses: actions/cache@v5
with:
path: |
pruning.list.gen
domain_substitution.list.gen
# Deliberately exclude the checked-in lists so changes to them are
# still validated against the previously generated results.
key: >-
${{ runner.os }}-source-file-lists-v1-${{
hashFiles(
'.python-version',
'chromium_version.txt',
'downloads.ini',
'deps.ini',
'domain_regex.list',
'devutils/update_lists.py',
'utils/domain_substitution.py',
'utils/prune_binaries.py'
)
}}
- name: Generate source file lists
if: steps.source-file-lists-cache.outputs.cache-hit != 'true'
run: |
./devutils/update_lists.py \
--tree chromium_src \
--pruning pruning.list.gen \
--domain-substitution domain_substitution.list.gen \
--no-error-unused
- name: Validate source file lists
run: |
diff -u pruning.list pruning.list.gen
diff -u domain_substitution.list domain_substitution.list.gen