diff --git a/.github/workflows/build_website.yml b/.github/workflows/build_website.yml index 95955f0..65f4588 100644 --- a/.github/workflows/build_website.yml +++ b/.github/workflows/build_website.yml @@ -3,7 +3,13 @@ name: Build Website on: push: branches: [main] + paths: + - 'src/**' + - 'data/**/*.json' pull_request: + paths: + - 'src/**' + - 'data/**/*.json' workflow_dispatch: # If another web build starts for the same branch, cancel the previous build. This @@ -26,35 +32,55 @@ jobs: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} steps: - # Configure Environment - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - id: "setup-node" - with: - node-version: '19' - cache: 'npm' - cache-dependency-path: 'src/tie-web-interface/package-lock.json' - - name: Install dependencies - working-directory: src/tie-web-interface/ - run: npm ci + # Configure Environment + - uses: actions/checkout@v3 - # Lint - - name: Lint - working-directory: src/tie-web-interface/ - run: npm run lint + # Configure Node + - uses: actions/setup-node@v3 + id: "setup-node" + with: + node-version: '19' + cache: 'npm' + cache-dependency-path: 'src/tie-web-interface/package-lock.json' + - name: Install dependencies + working-directory: src/tie-web-interface/ + run: npm ci + + # Lint + - name: Lint + working-directory: src/tie-web-interface/ + run: npm run lint - # Build and Upload Artifact - - name: Type Check - working-directory: src/tie-web-interface/ - run: npm run type-check - - name: Build - working-directory: src/tie-web-interface/ - run: npm run build-only -- --base /$BRANCH_NAME/ - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: tie_website - path: src/tie-web-interface/dist/ + # Run Type Checks + - name: Type Check + working-directory: src/tie-web-interface/ + run: npm run type-check + + # Configure Python + - uses: actions/setup-python@v4 + with: + python-version: '3.11.8' + - name: Install Poetry + run: curl -sSL https://install.python-poetry.org/ | python - + - name: Add Poetry to PATH + run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH + - name: Install dependencies + run: poetry install + + # Train Model + - name: Retrain Technique Inference Engine Model + working-directory: src/tie-web-interface/ + run: npm run build-model + + # Build Website + - name: Compile Website + working-directory: src/tie-web-interface/ + run: npm run build-only -- --base /$BRANCH_NAME/ + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: tie_website + path: src/tie-web-interface/dist/ # Publish to Azure blob only on PRs, not main. azure_blob: diff --git a/.github/workflows/python_test.yml b/.github/workflows/python_test.yml index 81d613e..47a459b 100644 --- a/.github/workflows/python_test.yml +++ b/.github/workflows/python_test.yml @@ -3,7 +3,11 @@ name: Python Tests on: push: branches: [main] + paths: + - 'src/**' pull_request: + paths: + - 'src/**' jobs: test: @@ -13,7 +17,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.11.8' - name: Install Poetry run: curl -sSL https://install.python-poetry.org/ | python - - name: Add Poetry to PATH @@ -24,7 +28,7 @@ jobs: run: poetry run ruff format --check src/ - name: Check imports formatting run: poetry run ruff check src/ - - name: Check type annotations + # - name: Check type annotations # run: poetry run mypy --check src/ - name: Run unit tests run: poetry run make test-ci diff --git a/src/tie-web-interface/.gitignore b/src/tie-web-interface/.gitignore index 8ee54e8..1166f49 100644 --- a/src/tie-web-interface/.gitignore +++ b/src/tie-web-interface/.gitignore @@ -28,3 +28,6 @@ coverage *.sw? *.tsbuildinfo + +# Ignore Model +app.trained.model.zip diff --git a/src/tie-web-interface/public/app.trained.model.zip b/src/tie-web-interface/public/app.trained.model.zip deleted file mode 100644 index e484bf9..0000000 Binary files a/src/tie-web-interface/public/app.trained.model.zip and /dev/null differ diff --git a/src/tie-web-interface/src/App.vue b/src/tie-web-interface/src/App.vue index 0797fe2..7397c08 100644 --- a/src/tie-web-interface/src/App.vue +++ b/src/tie-web-interface/src/App.vue @@ -11,6 +11,7 @@