CI #67
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" | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test_rain: | |
| # Avoid running twice for a push + PR | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
| runs-on: ubuntu-24.04 | |
| services: | |
| docker: | |
| image: docker:dind | |
| options: --privileged --shm-size=2g | |
| volumes: | |
| - /var/run/docker.sock:/var/run/docker.sock:ro | |
| steps: | |
| - name: Get the code | |
| uses: actions/checkout@v4 | |
| # Install/cache OpenJDK | |
| - name: Cache OpenJDK | |
| id: cache-openjdk | |
| uses: actions/cache@v4 | |
| with: | |
| path: /usr/lib/jvm/java-11-openjdk-amd64 | |
| key: ${{ runner.os }}-openjdk-11 | |
| restore-keys: | | |
| ${{ runner.os }}-openjdk-11 | |
| - name: Install OpenJDK | |
| if: ${{ steps.cache-openjdk.outputs.cache-hit != 'true' }} | |
| run: sudo apt-get install openjdk-11-jdk | |
| # Install/cache Nextflow | |
| - name: Cache Nextflow | |
| id: cache-nextflow | |
| uses: actions/cache@v4 | |
| with: | |
| path: /usr/local/bin/nextflow | |
| key: ${{ runner.os }}-nextflow | |
| restore-keys: | | |
| ${{ runner.os }}-nextflow | |
| - name: Install Nextflow | |
| if: ${{ steps.cache-nextflow.outputs.cache-hit != 'true' }} | |
| run: cat .github/workflows/install_nextflow_v24.10.5.sh | bash && mv nextflow /usr/local/bin && chmod +x /usr/local/bin/nextflow | |
| # Check-out the repo under $GITHUB_WORKSPACE so that the job can access it | |
| - uses: actions/checkout@v4 | |
| - name: Cache Dockerfiles and TAR | |
| id: cache-dockerfiles | |
| uses: actions/cache@v4 | |
| with: | |
| path: docker-images.tar | |
| key: ${{ runner.os }}-dockerfiles-${{ hashFiles('docker/**/*') }} | |
| - name: Load cached Docker images | |
| id: load-cache | |
| run: | | |
| if [ -f docker-images.tar ]; then | |
| echo "Loading cached Docker images..." | |
| docker load -i docker-images.tar || true | |
| echo "build=false" >> $GITHUB_ENV | |
| else | |
| echo "No Docker cache found" | |
| echo "build=true" >> $GITHUB_ENV | |
| fi | |
| - name: Build images | |
| if: env.build == 'true' || steps.cache-dockerfiles.outputs.cache-hit != 'true' | |
| run: bash build_images.sh github_action | |
| # Run test(s) | |
| - name: test short single | |
| run: nextflow run rain.nf -profile docker,test | |
| - name: test short paired | |
| run: nextflow run rain.nf -profile docker,test2 | |