Log subworkflow dependencies on install (#3871) #93
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CodSpeed benchmarks | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| pull_request: | |
| # `workflow_dispatch` allows CodSpeed to trigger backtest | |
| # performance analysis in order to generate initial data. | |
| workflow_dispatch: | |
| # Cancel if a newer run with the same workflow name is queued | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| id-token: write # for OpenID Connect authentication with CodSpeed | |
| jobs: | |
| startup-benchmarks: | |
| name: Run start-up benchmarks | |
| runs-on: codspeed-macro | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| name: Check out source-code repository | |
| - name: Set up Python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Install Nextflow | |
| uses: nf-core/setup-nextflow@b4ec1bc7c16a94435159de94a05253542fddf6ef # v3 | |
| with: | |
| version: ${{ github.event.inputs.nextflow-version || matrix.nextflow-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync --all-extras | |
| # Clone nf-core/modules into the local cache here, while network is | |
| # available. The modules-install benchmark then runs entirely offline | |
| # (no per-round fetch), so it stays deterministic even if the CodSpeed | |
| # step sandboxes network during measurement. | |
| - name: Warm nf-core/modules cache | |
| run: uv run python -c "from nf_core.modules.modules_repo import ModulesRepo; ModulesRepo()" | |
| # These benchmarks spawn a fresh interpreter per round to measure | |
| # import/start-up cost, which CodSpeed's instruction-counting | |
| # "simulation" instrument can't see. Use "walltime" mode instead. | |
| - name: Run start-up benchmarks | |
| uses: CodSpeedHQ/action@f99becdce5e5d51fd556489ebef684f4ecfd6286 # v4.18.5 | |
| with: | |
| mode: walltime | |
| run: uv run pytest benchmarks/test_startup_benchmarks.py --codspeed |