Weekly Collection #20
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: Weekly Collection | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| slack_channel: | |
| description: Slack channel to post the error message to if the builds fail. | |
| required: false | |
| default: "sdv-alerts-debug" | |
| schedule: | |
| - cron: '1 0 * * 0' | |
| jobs: | |
| weekly_github_collection: | |
| environment: weekly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| activate-environment: true | |
| - name: Install dependencies | |
| run: | | |
| uv pip install . | |
| - name: Collect GitHub Data | |
| run: | | |
| uv run gitmetrics collect -q \ | |
| --add-metrics \ | |
| --config-file weekly.yaml \ | |
| --token ${{ secrets.GITHUB_TOKEN }} \ | |
| --output-folder ${{ secrets.OUTPUT_FOLDER }} | |
| env: | |
| PYDRIVE_CREDENTIALS: ${{ secrets.PYDRIVE_CREDENTIALS }} | |
| - name: Consolidate GitHub Data | |
| run: | | |
| uv run gitmetrics consolidate \ | |
| --config-file weekly.yaml \ | |
| --output-folder ${{ secrets.OUTPUT_FOLDER }} | |
| env: | |
| PYDRIVE_CREDENTIALS: ${{ secrets.PYDRIVE_CREDENTIALS }} | |
| alert: | |
| needs: [weekly_github_collection] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| if: failure() | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| enable-cache: true | |
| activate-environment: true | |
| - name: Install dependencies | |
| run: | | |
| uv pip install .[dev] | |
| - name: Slack alert if failure | |
| run: python -m gitmetrics.slack_utils -r ${{ github.run_id }} -c ${{ github.event.inputs.slack_channel || 'sdv-alerts' }} | |
| env: | |
| SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }} |