Skip to content

Commit

Permalink
Merge pull request #46 from Acellera/ci
Browse files Browse the repository at this point in the history
Ci
  • Loading branch information
albertbou92 authored Aug 6, 2024
2 parents c6b2c04 + 1535721 commit fecf3d1
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/unittests/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch torchvision MolScore promptsmiles

if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

pip install torchrl

cd ../acegen-open
pip install -e .
7 changes: 7 additions & 0 deletions .github/unittests/install_dependencies.shyy
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov hydra-core tqdm torch torchvision, MolScore, promptsmiles

pip install torchrl

cd ../acegen-open
pip install -e .
17 changes: 17 additions & 0 deletions .github/unittests/install_dependencies_nightly.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-cov hydra-core tqdm

# Not using nightly torch, MolScore, promptsmiles
python -m pip install torch torchvision MolScore promptsmiles
# python -m pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall

cd ../acegen-open
pip install -e .
pip uninstall --yes torchrl
pip uninstall --yes tensordict

cd ..
python -m pip install git+https://github.com/pytorch-labs/tensordict.git
git clone https://github.com/pytorch/rl.git
cd rl
python setup.py develop
38 changes: 38 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: lint

on:
push:
branches: [ $default-branch , "main" ]
pull_request:
branches: [ $default-branch , "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Lint
run: |
python -m pip install --upgrade pip
pip install pre-commit
set +e
pre-commit run --all-files
if [ $? -ne 0 ]; then
git --no-pager diff
exit 1
fi
38 changes: 38 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: unit_tests

on:
push:
branches: [ $default-branch , "main" ]
pull_request:
branches: [ $default-branch , "main" ]

permissions:
contents: read

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10","3.11"]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
bash .github/unittest/install_dependencies_nightly.sh
- name: Test with pytest
run: |
pytest test/ --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
- if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false

0 comments on commit fecf3d1

Please sign in to comment.