str2list function tested #11
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.14'] | |
| 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 system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y poppler-utils | |
| - name: Upgrade pip, setuptools, and packaging | |
| run: | | |
| python -m pip install --upgrade pip setuptools packaging | |
| - name: Cache src directory | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./src/ | |
| key: ${{ runner.os }}-src-grch37 | |
| restore-keys: | | |
| ${{ runner.os }}-src- | |
| - name: Download GRCh37.tar.gz if not present | |
| run: | | |
| if [ ! -f ./src/GRCh37.tar.gz ]; then | |
| wget --connect-timeout=10 --tries=20 ftp://alexandrovlab-ftp.ucsd.edu/pub/tools/SigProfilerMatrixGenerator/GRCh37.tar.gz -P ./src/ | |
| fi | |
| - name: Install package with tests | |
| run: | | |
| pip install .[tests] | |
| - name: Install genome | |
| run: | | |
| SigProfilerMatrixGenerator install GRCh37 --local_genome ${{ github.workspace }}/src/ | |
| - name: Run unit tests | |
| run: | | |
| pytest tests | |
| - name: Run integration test | |
| run: | | |
| python3 test.py | |
| - name: Build and push Docker image | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' && matrix.python-version == '3.12' | |
| run: | | |
| echo "Starting Docker deployment to GHCR for sigprofilersuite..." | |
| VERSION_TAG=$(grep "VERSION = " setup.py | cut -d'"' -f2) | |
| # Get the repository name and convert it to lowercase | |
| REPO_NAME=$(basename ${{ github.repository }} | tr '[:upper:]' '[:lower:]') | |
| IMAGE_NAME="ghcr.io/sigprofilersuite/$REPO_NAME" | |
| echo "Building version: $VERSION_TAG for image: $IMAGE_NAME" | |
| echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io \ | |
| --username "${{ github.actor }}" \ | |
| --password-stdin | |
| docker build \ | |
| --build-arg COMMIT_SHA=${{ github.sha }} \ | |
| -t $IMAGE_NAME:$VERSION_TAG \ | |
| -t $IMAGE_NAME:latest . | |
| docker push $IMAGE_NAME:$VERSION_TAG | |
| docker push $IMAGE_NAME:latest | |
| echo "Docker deployment to GHCR successful" |