Skip to content
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

Add GH workflow for running analysis #18

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ trim_trailing_whitespace = true

[*.js]
indent_size = 2

[*.yml]
indent_size = 2
74 changes: 74 additions & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Analyze

env:
TEST_PATTERN: '*justice.gov/*'

on:
pull_request: {}
workflow_dispatch:
inputs:
threshold:
description: 'Threshold'
required: false
type: string
pattern:
description: 'Pattern'
required: false
type: string
default: ''
from:
description: 'From Time'
required: false
type: string
default: ''
to:
description: 'To Time'
required: false
type: string
default: ''

jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: pip

- name: Install System Dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc g++ pkg-config libxml2-dev libxslt-dev libz-dev

- name: Install Python Dependencies
run: pip install -r requirements.txt

- name: Download NLTK Corpora
run: |
python -m nltk.downloader stopwords

- name: Analyze!
run: |
# FIXME: set up readability running in a background process.
# We probably need to bring the code over from
# web-monitoring-changed-terms-analysis
python generate_task_sheets.py \
--output out \
--after '${{ inputs.from || '240' }}' \
--before '${{ inputs.to || '0' }}' \
--threshold '${{ inputs.threshold || '0.25' }}' \
--pattern '${{ inputs.pattern || env.TEST_PATTERN }}' \
--skip-readability

- name: Upload Results
uses: actions/upload-artifact@v4
with:
name: output
path: out
if-no-files-found: error
# TODO: what's appropriate retention here?
# retention-days: 1
Loading