randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.59k stars 569 forks source link

Chore: Centralize some Repository Config #4422

Closed reneme closed 2 weeks ago

reneme commented 3 weeks ago

This centralizes some repo-specific configuration into src/configs/repo_config.env. The settings are pulled into the CI's environment using a new GitHub action in .github/actions/read-repo-config.

The configuration in this file is relevant mostly for CI at the moment. Hence, no build scripts that are meant to be run locally are relying on those variables; perhaps except ci_build.py. In case that ever changes, the src/scripts/repo_config.py may be used to query the settings, either as a convenient CLI, or as a python module. E.g.

python3 src/scripts/repo_config.py get BORINGSSL_REPO
# prints 'randombit/boringssl

or

from repo_config import RepoConfig
cfg = RepoConfig()
print(cfg['BORINGSSL_REPO'])

This is an initial proposal. There's most likely more info that could live in such a config file. Also, I'm certainly open to criticism and improvement proposals with this. We use a similar setup in sehlen-bsi/botan-docs and that proved to be fairly useful.

Currently "Setup Build Agent" and "Read Repository Config" are deliberately split into two actions for flexibility in the setup of CI workflows. Though, at the moment they are always used together. Perhaps it makes sense to simply read the config in the setup job.

Closes #4390

coveralls commented 3 weeks ago

Coverage Status

coverage: 91.031% (-0.04%) from 91.072% when pulling c6602035186fdace007394be9a1efc93e9eebf0b on Rohde-Schwarz:chore/repo_config into bd045b1a02002b9a2f3f314da0ee55912aebb23f on randombit:master.

randombit commented 2 weeks ago

@reneme seems to be a problem with the SDE job can you take a look https://github.com/randombit/botan/actions/runs/11640528851/job/32421150718

reneme commented 2 weeks ago

I accidentally removed the $PATH amendment. Therefore, the sde executable wasn't found. It didn't show up in the PR's CI because the nightly jobs didn't run. (I'm guessing because the final commit didn't change nightly.yml, c.f. #4414.