.github/workflows/main.yml #2179
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
| on: | |
| push: | |
| schedule: | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| mathlib_stats: | |
| if: github.event.pusher.name != 'leanprover-community-bot' | |
| runs-on: ubuntu-latest | |
| name: Generate statistics about the mathlib repo | |
| steps: | |
| - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.MAILMAP_APP_ID }} | |
| private-key: ${{ secrets.MAILMAP_PRIVATE_KEY }} | |
| owner: leanprover-community | |
| repositories: mathlib-mailmap | |
| - name: Checkout scripts | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Checkout mathlib | |
| run: git clone https://github.com/leanprover-community/mathlib | |
| - name: Checkout mathlib4 | |
| run: git clone https://github.com/leanprover-community/mathlib4 | |
| - name: Checkout mathlib-mailmap | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| # this repo is private to prevent spambots from scraping email addresses | |
| repository: leanprover-community/mathlib-mailmap | |
| token: ${{ steps.app-token.outputs.token }} | |
| path: mailmap | |
| - name: install Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: 3.8 | |
| - name: Count contributors with script from mathlib-mailmap | |
| run: | | |
| cd mailmap | |
| ./count > ../docs/contributor-count | |
| cat ../docs/contributor-count | |
| - name: Run gitstats | |
| run: | | |
| cp mailmap/mailmap mathlib/.mailmap | |
| cp mailmap/mailmap mathlib4/.mailmap | |
| ./gitstats.py mathlib docs | |
| mkdir docs4 | |
| cp docs/gitstats4.cache docs4/gitstats.cache || true | |
| ./gitstats.py mathlib4 docs4 | |
| cp docs4/gitstats.js docs/gitstats4.js | |
| cp docs4/gitstats.cache docs/gitstats4.cache | |
| - name: push results | |
| # push results when we push to master | |
| if: github.repository == 'leanprover-community/mathlib_stats' && github.ref == 'refs/heads/master' | |
| uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 | |
| with: | |
| add: 'docs' | |
| author_name: 'leanprover-community-bot' | |
| author_email: 'leanprover.community@gmail.com' | |
| message: 'Update gitstats' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |