Modernize CI workflows #1578
Workflow file for this run
This file contains hidden or 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
| name: Test with PyTest | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| pip install pytest pytest-xdist | |
| pip uninstall textattack --yes | |
| python setup.py install_egg_info | |
| pip install -e .[test] | |
| pip freeze | |
| - name: Download NLTK data | |
| run: | | |
| python -c "import nltk; nltk.download('punkt_tab'); nltk.download('averaged_perceptron_tagger'); nltk.download('stopwords'); nltk.download('omw-1.4'); nltk.download('wordnet')" | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/local/lib/android >/dev/null 2>&1 | |
| sudo rm -rf /usr/share/dotnet >/dev/null 2>&1 | |
| df -h | |
| - name: Test with pytest | |
| run: | | |
| pytest tests -v |