Run All Pipelines #620
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: Run All Pipelines | |
| "on": | |
| schedule: | |
| - cron: "0 0 * * *" # Run daily at midnight | |
| workflow_dispatch: # Allow manual triggers | |
| pull_request: | |
| paths: | |
| - "pipeline/**" | |
| - ".github/workflows/run_pipelines.yml" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "pipeline/**" | |
| - ".github/workflows/run_pipelines.yml" | |
| env: | |
| SOURCES__GITHUB_PIPELINE__GITHUB__API_TOKEN: ${{ secrets.GH_TOKEN_STATS_PAGE }} | |
| SOURCES__SLACK_PIPELINE__SLACK__API_TOKEN: ${{ secrets.SLACK_USER_TOKEN }} | |
| # Do not include motherduck tokens in case of a PR event, to avoid accidentically pushing to the prod database | |
| DESTINATION__MOTHERDUCK__CREDENTIALS__DATABASE: ${{ github.event_name != 'pull_request' && 'nf_core_stats_bot' || '' }} | |
| DESTINATION__MOTHERDUCK__CREDENTIALS__PASSWORD: ${{ github.event_name != 'pull_request' && secrets.MOTHERDUCK_TOKEN || '' }} | |
| # For pull requests, use local DuckDB instead of MotherDuck | |
| DESTINATION__DUCKDB__CREDENTIALS: ${{ github.event_name == 'pull_request' && './nf_core_stats.duckdb' || '' }} | |
| PYTHONUNBUFFERED: "1" | |
| jobs: | |
| maybe_skip: | |
| name: Skip if duplicate | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5 | |
| with: | |
| concurrent_skipping: always | |
| skip_after_successful_duplicate: false | |
| run_pipelines: | |
| name: Run ${{ matrix.pipeline }} pipeline | |
| needs: maybe_skip | |
| if: needs.maybe_skip.outputs.should_skip != 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - pipeline: github | |
| uuid: 73f22c65-592a-4368-8fc5-23787c1dc67d | |
| - pipeline: slack | |
| uuid: 585d7c4f-abc9-49fa-980f-64d950d6fd2b | |
| - pipeline: citations | |
| uuid: 40694d0-50ed-4bb7-919d-463d3555b23f | |
| defaults: | |
| run: | |
| working-directory: pipeline | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7 | |
| with: | |
| python-version: "3.10" | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| **/pyproject.toml | |
| **/uv.lock | |
| - name: Install runitor | |
| env: | |
| RUNITOR_VERSION: "v1.3.0-build.4" | |
| run: | | |
| # Download binary and SHA256 file | |
| curl -fsSL -o runitor \ | |
| "https://github.com/bdd/runitor/releases/download/${RUNITOR_VERSION}/runitor-${RUNITOR_VERSION}-linux-amd64" | |
| # Make executable and test | |
| chmod +x runitor | |
| ./runitor -version | |
| sudo mv runitor /usr/local/bin/ | |
| - name: Get ${{ matrix.pipeline }} stats | |
| run: | | |
| runitor -uuid ${{ matrix.uuid }} -- \ | |
| uv run nf_core_stats ${{ matrix.pipeline }} ${{ github.event_name == 'pull_request' && '--destination duckdb' || '' }} | |
| - name: Upload DuckDB artifacts | |
| if: github.event_name == 'pull_request' | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 | |
| with: | |
| name: duckdb-${{ matrix.pipeline }} | |
| path: pipeline/nf_core_stats.duckdb | |
| retention-days: 7 |