Skip to content

Commit

Permalink
Merge branch 'edge' into te-server-refactor-1
Browse files Browse the repository at this point in the history
  • Loading branch information
tevko authored Jan 13, 2025
2 parents 0cb49b2 + 6d04f4d commit 4d2c6c6
Show file tree
Hide file tree
Showing 63 changed files with 3,032 additions and 2,419 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/sensemaker-cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Generate Sensemaker report

on: workflow_dispatch

jobs:
generate-summary:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: "tevko/sensemaking-tools"
path: sensemaking-tools

- uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'

- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache-dependency-path: sensemaking-tools/package-lock.json
node-version: "18"
cache: "npm"

- name: Install dependencies
run: npm install
working-directory: sensemaking-tools

- name: Get CSV
uses: valitydev/action-download-file@v1
with:
url: https://preprod.pol.is/api/v3/reportExport/r7kfpvrhdpyykbhnirtcd/comment-groups.csv
target-path: sensemaking-tools/data/

- name: Modify CSV headers
run: |
ls -l data/
file="data/comment-groups.csv"
new_header="comment-id,comment_text,total-votes,total-agrees,total-disagrees,total-passes,group-a-votes,group-0-agree-count,group-0-disagree-count,group-0-pass-count,group-b-votes,group-1-agree-count,group-1-disagree-count,group-1-pass-count"
sed -i "1s/.*/$new_header/" "$file"
working-directory: sensemaking-tools

- name: List Files
run: ls -l sensemaking-tools/

- name: Generate Summary Output
run: |
npx ts-node runner-cli/runner.ts --outputFile "summary" \
--vertexProject "jigsaw-vertex-integration" \
--inputFile "data/comment-groups.csv"
# run: |
# echo "<html>test</html>" > summary.html
working-directory: sensemaking-tools

- name: Upload HTML as Artifact
uses: actions/upload-artifact@v3
with:
name: sensemaking-summary-html
path: sensemaking-tools/summary.html

use_html:
needs: generate-summary
runs-on: ubuntu-latest
steps:
- name: Download HTML Artifact
uses: actions/download-artifact@v3
with:
name: sensemaking-summary-html
path: downloaded-html
# - name: Checkout
# uses: actions/checkout@v3
- name: debug
run: |
ls -al
ls -al downloaded-html
- name: Deploy to gist
uses: exuanbo/actions-deploy-gist@v1
with:
token: ${{ secrets.GIST_TOKEN }}
gist_id: 2ea3c0f4cadffbde9c414c8d203cd599
file_path: downloaded-html/summary.html
file_type: html
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ build/
prod.env
xids.csv
preprod.env
.venv/
.venv
1 change: 1 addition & 0 deletions client-report/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ const config = {

// Whether to use watchman for file crawling
// watchman: true,
setupFilesAfterEnv: ["<rootDir>/setupTests.js"]
};

module.exports = config;
90 changes: 90 additions & 0 deletions client-report/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions client-report/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@babel/preset-react": "~7.18.6",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"babel-jest": "^29.7.0",
"babel-loader": "~9.1.2",
"compression-webpack-plugin": "^10.0.0",
Expand All @@ -32,6 +33,7 @@
"html-webpack-plugin": "^5.5.3",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"mini-css-extract-plugin": "^2.7.6",
"webpack": "~5.88.0",
"webpack-cli": "~5.1.4",
Expand Down
5 changes: 5 additions & 0 deletions client-report/setupTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// import fetch from 'node-fetch';
import '@testing-library/jest-dom';
import fetchMock from 'jest-fetch-mock';

fetchMock.enableMocks();
Loading

0 comments on commit 4d2c6c6

Please sign in to comment.