curl/.github/workflows/checksrc.yml
Viktor Szakats db5d888673
GHA: explicitly brew update before brew install with Linuxbrew
Fixing:
```
==> Installing openssl@3 dependency: ca-certificates
==> Pouring ca-certificates--2026-05-14.all.bottle.tar.gz
Error: undefined method '[]' for nil
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/bottles.rb:127:in 'Utils::Bottles.load_tab'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula_installer.rb:1507:in 'FormulaInstaller#pour'
[...]
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:114:in '<main>'
You have disabled automatic updates and have not updated today.
Do not report this issue until you've run `brew update` and tried again.
Error: Process completed with exit code 1.
```
Ref: https://github.com/curl/curl/actions/runs/25859030402/job/75984082148?pr=21607

Dropping `HOMEBREW_NO_AUTO_UPDATE=1` was not enough to fix it.

Closes #21608
2026-05-14 14:26:43 +02:00

194 lines
5.4 KiB
YAML

# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl
# This workflow contains checks at the source code level only.
name: 'Source'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
pull_request:
branches:
- master
paths-ignore:
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
DO_NOT_TRACK: '1'
jobs:
checksrc:
name: 'checksrc'
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check'
run: scripts/checksrc-all.pl
linters:
name: 'spellcheck, linters, REUSE'
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'install prereqs'
run: |
python3 -m venv ~/venv
~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary \
-r .github/scripts/requirements.txt \
-r tests/http/requirements.txt \
-r tests/requirements.txt
- name: 'REUSE check'
run: |
source ~/venv/bin/activate
reuse lint
- name: 'codespell'
run: |
source ~/venv/bin/activate
codespell --version
.github/scripts/codespell.sh
- name: 'typos'
timeout-minutes: 2
run: |
/home/linuxbrew/.linuxbrew/bin/brew update
/home/linuxbrew/.linuxbrew/bin/brew install typos-cli
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
typos --version
.github/scripts/typos.sh
- name: 'cmakelint'
run: |
source ~/venv/bin/activate
scripts/cmakelint.sh
- name: 'perlcheck'
run: |
scripts/perlcheck.sh
- name: 'pytype'
run: |
source ~/venv/bin/activate
find . -name '*.py' -exec pytype -j auto -k -- {} +
- name: 'ruff'
run: |
source ~/venv/bin/activate
scripts/pythonlint.sh
complexity:
name: 'complexity and function sizes'
runs-on: ubuntu-slim
timeout-minutes: 3
steps:
- name: 'install pmccabe'
timeout-minutes: 2
run: |
ls -l /etc/apt/sources.list.d
sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install pmccabe
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check function complexity'
run: ./scripts/top-complexity
- name: 'check function lengths'
run: ./scripts/top-length
xmllint:
name: 'xmllint'
runs-on: ubuntu-slim
timeout-minutes: 3
steps:
- name: 'install prereqs'
timeout-minutes: 2
run: |
sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print
sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
sudo apt-get -o Dpkg::Use-Pty=0 update
sudo apt-get -o Dpkg::Use-Pty=0 install libxml2-utils
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'check'
run: git grep -z -i -l -E '^<\?xml' | xargs -0 -r xmllint --output /dev/null
miscchecks:
name: 'misc checks'
runs-on: ubuntu-24.04-arm
timeout-minutes: 5
steps:
- name: 'install prereqs'
timeout-minutes: 2
run: |
/home/linuxbrew/.linuxbrew/bin/brew update
/home/linuxbrew/.linuxbrew/bin/brew install actionlint shellcheck zizmor
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'zizmor GHA'
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
zizmor --persona pedantic .github/workflows/*.yml .github/dependabot.yml
- name: 'actionlint'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
export SHELLCHECK_OPTS='--exclude=1090,1091,2086,2153 --enable=avoid-nullary-conditions,deprecate-which'
actionlint --version
actionlint --ignore matrix .github/workflows/*.yml
- name: 'shellcheck CI'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
shellcheck --version
.github/scripts/shellcheck-ci.sh
- name: 'shellcheck'
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
shellcheck --version
.github/scripts/shellcheck.sh
- name: 'spacecheck'
run: scripts/spacecheck.pl
- name: 'yamlcheck'
run: .github/scripts/yamlcheck.sh
- name: 'badwords'
run: scripts/badwords-all