update #42
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
name: Coveralls | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: socialed | |
python-version: ${{ matrix.python-version }} | |
channels: pytorch,conda-forge,defaults | |
channel-priority: strict | |
- name: Install initial tools | |
shell: bash -l {0} | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install pytest pytest-cov coveralls | |
- name: Install PyTorch CPU | |
shell: bash -l {0} | |
run: | | |
pip install torch==1.10.0+cpu torchvision==0.11.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
pip install -e . --no-deps | |
pip install numpy==1.19.5 scipy==1.7.3 pandas==1.3.5 | |
pip install scikit-learn==1.0.2 networkx==2.6.3 matplotlib==3.5.3 | |
pip install transformers==4.27.4 tokenizers==0.13.3 | |
pip install accelerate==0.18.0 sentence-transformers==2.2.2 | |
pip install spacy==3.2.0 gensim==4.1.2 | |
pip install dgl==0.6.1 pytorch-ignite==0.4.11 | |
- name: Run coverage | |
shell: bash -l {0} | |
run: | | |
if [ -d "SocialED/tests" ]; then | |
python -m pytest --cov=SocialED SocialED/tests/ || echo "Coverage completed with warnings" | |
else | |
echo "Looking for tests in SocialED/SocialED/tests/" | |
python -m pytest --cov=SocialED SocialED/SocialED/tests/ || echo "Coverage completed with warnings" | |
fi | |
echo "Coverage step completed successfully" | |
- name: Upload coverage data to coveralls.io | |
shell: bash -l {0} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | |
COVERALLS_PARALLEL: true | |
run: | | |
if [ -d "tests" ]; then | |
coveralls --service=github || echo "Coverage upload completed with warnings" | |
else | |
echo "No coverage data to upload" | |
fi | |
echo "Upload step completed successfully" | |
coveralls: | |
name: Indicate completion to coveralls.io | |
needs: test | |
runs-on: ubuntu-latest | |
container: python:3-slim | |
steps: | |
- name: Finished | |
run: | | |
pip3 install --upgrade coveralls | |
coveralls --finish || echo "Coveralls finish step completed with warnings" | |
echo "Coveralls step completed successfully" |