mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
b53163d96e
should hopefully speed up ci by some amount
140 lines
4.2 KiB
YAML
140 lines
4.2 KiB
YAML
name: Code Validation
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
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
|
|
./utils/clone.py -o chromium_src
|
|
rm -rf chromium_src/uc_staging
|
|
find chromium_src -type d -name '.git' -exec rm -rf "{}" \; -prune
|
|
tar cf "chromium_download_cache/chromium-$(cat chromium_version.txt)-lite.tar.xz" \
|
|
--transform "s/chromium_src/chromium-$(cat chromium_version.txt)/" chromium_src
|
|
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
|