diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64f9214..cb5f3e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Deploy HiViSer GitHub Pages +name: Deploy Viewer to GitHub Pages on: push: @@ -23,7 +23,7 @@ jobs: WITH_V: true deploy: - name: Deploy HiViSer Frontend to GitHub Pages ๐Ÿš€ + name: Deploy Frontend to GitHub Pages ๐Ÿš€ concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession. runs-on: ubuntu-latest steps: @@ -55,7 +55,7 @@ jobs: run: | cd frontend pnpm install - pnpm run build + pnpm run build:pages - name: Deploy Frontend ๐Ÿš€ uses: JamesIves/github-pages-deploy-action@v4.3.3 diff --git a/.github/workflows/tagged-release.yml b/.github/workflows/tagged-release.yml index 8412981..28c1d69 100644 --- a/.github/workflows/tagged-release.yml +++ b/.github/workflows/tagged-release.yml @@ -11,7 +11,7 @@ jobs: runs-on: "ubuntu-latest" steps: - - name: Release HiViSer Action ๐ŸŽ‰ + - name: Release Analytics Treemap Embedding Action ๐ŸŽ‰ uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8561238..a0f3718 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,10 @@ -name: Test HiViSer Action +name: Test Analytics Treemap Embedding Action on: [push] jobs: test: - name: Run HiViSer Action ๐Ÿงช + name: Run Analytics Treemap Embedding Action ๐Ÿงช concurrency: group: ${{ github.ref }} cancel-in-progress: true # Recommended if you intend to make multiple deployments in quick succession. @@ -16,7 +16,7 @@ jobs: - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@v3 - - name: Run HiViSer Action ๐Ÿš€ + - name: Run Action ๐Ÿš€ uses: ./ # Uses the action in the root directory with: benchmark: true diff --git a/README.md b/README.md index dc98e68..a78dfad 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,15 @@ # github-software-analytics-embedding Seminar Project of the Seminar "Advanced Techniques for Analysis and Visualization of Software Data" of CGS, HPI and DEF in the Summer Term 2022 -# Usage +![image](https://user-images.githubusercontent.com/33397387/194839012-0c3efa5c-29cf-41b3-a686-1e9fd310c1a2.png) +This project contains: +- a dockerized github action to calculate typescript software metrics per commit and store them as a `.csv` file directly to the git repository under the custom ref `refs/metrics`. +- a React frontend to visualize the calculated metrics in a treemap. +- an embedding script to integrate the viewer into an existing webpage. + +โš ๏ธ Please note that this is a research prototype and not meant for use in production as of now. + +# Integration into your Github project Create a new GitHub Actions workflow in your project, e.g. at `.github/workflows/analytics-embedding.yml`. The content of the file should be in the following format: ```yaml name: Analytics Treemap Embedding @@ -26,15 +34,14 @@ jobs: - name: Check out Git repository uses: actions/checkout@v3 - - name: Run Hiviser Action - uses: hpicgs/hiviser-action@v0 + - name: Run Analytics Treemap Embedding Action ๐Ÿš€ + uses: hpicgs/github-software-analytics-embedding@v0 with: # Optional, use if you want to analyse a specific folder repository_path: ./ # Optional to enable benchmarking benchmark: true ``` - ## Development Install `pnpm`: @@ -52,7 +59,8 @@ pnpm i pnpm run dev ``` -Navigate to e.g. `localhost:3000/hpicgs/github-software-analytics-embedding/5b337b8409f2a2d3b1b14f85d52a97a0258fe256` +Navigate to `localhost:3000` in the browser of your choice. + ### Setup Code Anayltics Development locally Create an .env file ``` diff --git a/action.yml b/action.yml index db783f1..2f8b04f 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ -name: "HiViSer - Action" -description: "HiViSer visualisations for your repository" +name: "Analytics Treemap Embedding Action" +description: "A Github Action that provides code metrics and treemap visualisations for your typescript repository" branding: icon: "search" color: "blue" diff --git a/entrypoint.sh b/entrypoint.sh index 7d7da74..b732a77 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ echo $(tokei ./src -o json > metrics.json) if [[ -z "${GITHUB_TOKEN}" ]]; then - echo "GITHUB_TOKEN is not set. Stopping Hiviser Action." + echo "GITHUB_TOKEN is not set. Stopping Action." exit 0 fi diff --git a/frontend/.npmrc b/frontend/.npmrc new file mode 100644 index 0000000..f87a044 --- /dev/null +++ b/frontend/.npmrc @@ -0,0 +1 @@ +auto-install-peers=true \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index 49731a6..7ade108 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -7,7 +7,7 @@ - HiViser Action + Analytics Treemap Embedding Action