-
Notifications
You must be signed in to change notification settings - Fork 8
Collect file extension stats in gh-pages
#12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
935238c
d83a0be
860b329
5e51ed3
310f58d
14329ca
4526f9d
a63a6c2
948bdc4
c3593d8
d8145de
683d26e
3f1100a
38236f8
a08d57c
6e28547
985024b
eea523c
071c943
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| name: GitHub Pages | ||
| name: Build Stats | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| workflow_dispatch: | ||
| schedule: | ||
| # run every Sunday at 22:12 UTC | ||
| - cron: '12 22 * * 0' | ||
|
|
@@ -13,12 +14,11 @@ jobs: | |
| deploy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - uses: actions/checkout@v2 | ||
| with: | ||
| repository: mozilla/gecko-dev | ||
| path: gecko-dev | ||
| - name: Clone `gecko-dev` | ||
| run: | | ||
| git clone https://github.com/mozilla/gecko-dev.git | ||
|
|
||
| - run: npm install -g mustache | ||
|
|
||
|
|
@@ -29,6 +29,10 @@ jobs: | |
| cat build/data.json | ||
| mustache build/data.json index.mustache > build/index.html | ||
| cat build/index.html | ||
|
|
||
| - name: Gather commits by day and file extension statistics | ||
| run: | | ||
| ./01stats.sh gecko-dev build | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do we get out of this build step? Also I see that it takes pretty long time to complete.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal is to move stats collection commands out of GitHub Actions YAML, so that they could be run standalone. As I continued experiments in my |
||
|
|
||
| - name: Deploy | ||
| uses: JamesIves/[email protected] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| gecko-dev/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/bin/bash | ||
|
|
||
| REPODIR=${1:-.} # default to . if first argument is not set | ||
| SCRIPTDIR=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") | ||
| BUILDDIR=$(readlink -f "${2:-$SCRIPTDIR}") | ||
|
|
||
| [[ -d $BUILDDIR ]] || { echo "$BUILDDIR dir does not exist"; exit 1; } | ||
|
|
||
| (cd "$REPODIR" || exit | ||
|
|
||
| if $(git rev-parse --is-shallow-repository); then | ||
| echo "WARNING: Repository checkout is shallow. Data is incomplete." | ||
| fi | ||
|
|
||
| echo "writing $BUILDDIR/commits-per-day.txt" | ||
| git log --date=short --format="%cd" --reverse --topo-order | | ||
| uniq -c > "$BUILDDIR"/commits-per-day.txt | ||
|
|
||
| echo "writing $BUILDDIR/extensions.txt" | ||
| "$SCRIPTDIR"/dev/git-file-stats > "$BUILDDIR/extensions.txt" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testing workflow in branches other than
main.