Skip to content

Commit

Permalink
Merge pull request #33 from hpicgs/dev
Browse files Browse the repository at this point in the history
Release v0.7.0
  • Loading branch information
Jasperhino authored Oct 11, 2022
2 parents 5c19fb9 + 0d4cfd1 commit 4f829d2
Show file tree
Hide file tree
Showing 31 changed files with 339 additions and 213 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy HiViSer GitHub Pages
name: Deploy Viewer to GitHub Pages

on:
push:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tagged-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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`:
Expand All @@ -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
```
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions frontend/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
auto-install-peers=true
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"/>
<title>HiViser Action</title>
<title>Analytics Treemap Embedding Action</title>

<!-- Start Single Page Apps for GitHub Pages -->
<script type="text/javascript">
Expand Down
9 changes: 7 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
{
"name": "treemap-github-embedding",
"version": "0.1.0",
"version": "0.6.1",
"private": "true",
"homepage": "https://hpicgs.github.io/github-software-analytics-embedding/",
"scripts": {
"build": "tsc --noEmit && vite build",
"build:pages": "tsc --noEmit && vite build --base /github-software-analytics-embedding/",
"build:embed": "tsc --noEmit && vite build --config vite.config-embed.ts",
"deploy": "gh-pages -d dist",
"dev": "vite",
"dev:pages": "vite --base /github-software-analytics-embedding/",
"preinstall": "npx only-allow pnpm",
"preview": "vite preview"
"preview": "vite preview",
"preview:pages": "vite preview --base /github-software-analytics-embedding/"
},
"dependencies": {
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.10.6",
"@mui/material": "^5.8.6",
"buffer": "^6.0.3",
"isomorphic-fetch": "^3.0.0",
"octokit": "^1.8.1",
"papaparse": "^5.3.2",
"pretty-bytes": "^6.0.0",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-router-dom": "6",
Expand Down
Loading

0 comments on commit 4f829d2

Please sign in to comment.