Skip to content

Metrics

Metrics #1443

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Metrics"
on:
push:
branches: ["*"]
paths: [".github/workflows/metrics.yml"]
pull_request:
branches: ["*"]
paths: [".github/workflows/metrics.yml"]
schedule:
- cron: "55 05 * * *"
workflow_dispatch:
permissions: {}
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true
jobs:
generate-header-metrics:
name: "Generate header metrics"
runs-on: "ubuntu-latest"
permissions: {}
steps:
- uses: "lowlighter/metrics@65836723097537a54cd8eb90f61839426b4266b6"
with:
# Core
config_animations: true
config_base64: true
config_padding: "0, 20"
config_display: "regular"
config_output: "svg"
config_timezone: "UTC"
experimental_features: "--optimize-svg"
filename: "header.*"
optimize: "css, xml, svg"
output_action: "none"
template: "classic"
token: "${{ secrets.METRICS_TOKEN }}"
user: "${{ github.repository_owner }}"
# Base
base: "header"
- name: "Upload artifact"
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
with:
name: "header-metrics"
path: "/metrics_renders/"
retention-days: 1
generate-repositories-metrics:
name: "Generate repositories metrics"
runs-on: "ubuntu-latest"
permissions: {}
steps:
- uses: "lowlighter/metrics@65836723097537a54cd8eb90f61839426b4266b6"
with:
# Core
config_animations: true
config_base64: true
config_padding: "0, 30"
config_display: "regular"
config_output: "svg"
config_timezone: "UTC"
experimental_features: "--optimize-svg"
filename: "repositories.*"
optimize: "css, xml, svg"
output_action: "none"
template: "classic"
token: "${{ secrets.METRICS_TOKEN }}"
user: "${{ github.repository_owner }}"
# Base
base: "repositories"
repositories: 200
repositories_forks: false
- name: "Upload artifact"
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
with:
name: "repositories-metrics"
path: "/metrics_renders/"
retention-days: 1
generate-plugin-achievements-metrics:
name: "Generate achievements plugin metrics"
runs-on: "ubuntu-latest"
permissions: {}
steps:
- uses: "lowlighter/metrics@65836723097537a54cd8eb90f61839426b4266b6"
with:
# Core
config_animations: true
config_base64: true
config_padding: "0, 20"
config_display: "regular"
config_output: "svg"
config_timezone: "UTC"
experimental_features: "--optimize-svg"
filename: "plugin-achievements.*"
optimize: "css, xml, svg"
output_action: "none"
template: "classic"
token: "${{ secrets.METRICS_TOKEN }}"
user: "${{ github.repository_owner }}"
# Base
base: ""
# Achievements plugin
plugin_achievements: true
plugin_achievements_display: "compact"
plugin_achievements_secrets: true
plugin_achievements_threshold: "B"
- name: "Upload artifact"
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
with:
name: "plugin-achievements-metrics"
path: "/metrics_renders/"
retention-days: 1
generate-plugin-languages-metrics:
name: "Generate languages plugin metrics"
runs-on: "ubuntu-latest"
permissions: {}
steps:
- uses: "lowlighter/metrics@65836723097537a54cd8eb90f61839426b4266b6"
with:
# Core
config_animations: true
config_base64: true
config_padding: "0, 20"
config_display: "regular"
config_output: "svg"
config_timezone: "UTC"
experimental_features: "--optimize-svg"
filename: "plugin-languages.*"
optimize: "css, xml, svg"
output_action: "none"
template: "classic"
token: "${{ secrets.METRICS_TOKEN }}"
user: "${{ github.repository_owner }}"
# Base
base: ""
# Languages plugin
plugin_languages: true
plugin_languages_analysis_timeout: 15
plugin_languages_categories: "markup, programming"
plugin_languages_colors: "github"
plugin_languages_indepth: false
plugin_languages_limit: 8
plugin_languages_other: false
plugin_languages_sections: "most-used"
plugin_languages_threshold: "0%"
- name: "Upload artifact"
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
with:
name: "plugin-languages-metrics"
path: "/metrics_renders/"
retention-days: 1
generate-plugin-notable-metrics:
name: "Generate notable contributions plugin metrics"
runs-on: "ubuntu-latest"
permissions: {}
steps:
- uses: "lowlighter/metrics@65836723097537a54cd8eb90f61839426b4266b6"
with:
# Core
config_animations: true
config_base64: true
config_padding: "0, 40"
config_display: "regular"
config_output: "svg"
config_timezone: "UTC"
experimental_features: "--optimize-svg"
filename: "plugin-notable.*"
optimize: "css, xml, svg"
output_action: "none"
template: "classic"
token: "${{ secrets.METRICS_TOKEN }}"
user: "${{ github.repository_owner }}"
# Base
base: ""
# Notable contributions plugin
plugin_notable: true
plugin_notable_from: "all"
plugin_notable_indepth: false
plugin_notable_repositories: true
plugin_notable_types: "commit"
- name: "Upload artifact"
uses: "actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02"
with:
name: "plugin-notable-metrics"
path: "/metrics_renders/"
retention-days: 1
publish-metrics:
name: "Publish metrics"
if: "github.event_name != 'pull_request'"
needs:
- "generate-header-metrics"
- "generate-repositories-metrics"
- "generate-plugin-achievements-metrics"
- "generate-plugin-languages-metrics"
- "generate-plugin-notable-metrics"
runs-on: "ubuntu-latest"
permissions:
contents: "write"
steps:
- name: "Checkout"
uses: "actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8"
with:
ref: "${{ github.ref }}"
- name: "Download header metrics artifact"
uses: "actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0"
with:
name: "header-metrics"
path: "./metrics/"
- name: "Download repositories metrics artifact"
uses: "actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0"
with:
name: "repositories-metrics"
path: "./metrics/"
- name: "Download achievements plugin metrics artifact"
uses: "actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0"
with:
name: "plugin-achievements-metrics"
path: "./metrics/"
- name: "Download languages plugin metrics artifact"
uses: "actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0"
with:
name: "plugin-languages-metrics"
path: "./metrics/"
- name: "Download notable contributions plugin metrics artifact"
uses: "actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0"
with:
name: "plugin-notable-metrics"
path: "./metrics/"
- name: "Publish"
run: |
git config --global user.name 'hectorm-bot'
git config --global user.email '[email protected]'
if [ -n "$(git status --porcelain=v1 ./metrics/)" ]; then
git add ./metrics/
git commit -m "[skip ci] Metrics $(date -Iseconds)"
git push origin HEAD
fi