Skip to content

Commit

Permalink
change github workflows to require test to pass before docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Imel authored and Nathaniel Imel committed Nov 12, 2023
1 parent 62ced06 commit 58fa5a1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: build
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
call-workflow1:
name: tests
uses: ./.github/workflows/test.yml
call-workflow2:
needs: call-workflow1
name: docs
uses: ./.github/workflows/docs.yml
print:
needs: [call-workflow1]
runs-on: ubuntu-latest
steps:
- run: echo "${{ needs.call-workflow1 }}"
11 changes: 2 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
name: website
name: docs

# build the documentation whenever there are new commits on main
on:
push:
branches:
- main
# Alternative: only build for tags.
# tags:
# - '*'
on: workflow_call

# security: restrict permissions for CI jobs.
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: tests

on: [push]
on: workflow_call

jobs:
build:
Expand Down
6 changes: 5 additions & 1 deletion src/sciterra/vectorization/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import spacy

nlp = spacy.load("en_core_web_sm")
model = "en_core_web_sm"
try:
nlp = spacy.load(model)
except OSError:
raise OSError(f"Can't find model '{model}'; make sure you have run 'python3 -m spacy download {model}'!")

# Another off the shelf simple tokenizer
from gensim.utils import simple_preprocess
Expand Down

0 comments on commit 58fa5a1

Please sign in to comment.