[Snyk] Fix for 5 vulnerabilities #701
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run test and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
type-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Test with mypy | |
run: | | |
pip install mypy | |
# Refer http://mypy-lang.blogspot.com/2021/06/mypy-0900-released.html | |
pip install mypy types-requests types-python-dateutil types-PyYAML types-dateparser types-protobuf types-pytz | |
mypy obsei | |
build-cache: | |
needs: type-check | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python-version: ['3.7', '3.8', '3.9', '3.10'] | |
steps: | |
- uses: actions/checkout@v4.1.0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache | |
id: cache-python-env | |
uses: actions/cache@v3.3.1 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: cache-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
# - name: Install Pytorch on windows | |
# if: ${{ matrix.os == 'windows-latest' }} | |
# run: | | |
# pip install torch==1.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html | |
- name: Install dependencies | |
if: steps.cache-python-env.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
pip install '.[dev,all]' | |
pip install --upgrade --upgrade-strategy eager trafilatura | |
build: | |
needs: build-cache | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python-version: ['3.7', '3.8', '3.9', '3.10'] | |
steps: | |
- uses: actions/checkout@v4.1.0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache | |
uses: actions/cache@v3.3.1 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: cache-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }} | |
- name: Test with pytest | |
run: | | |
python -m spacy download en_core_web_lg | |
python -m spacy download en_core_web_sm | |
coverage run -m pytest | |
coverage report -m |