11name : CI
2- on : [push, pull_request, workflow_dispatch]
2+ on :
3+ push :
4+ branches :
5+ - " main"
6+ pull_request :
7+ workflow_dispatch :
38
49concurrency :
510 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -24,12 +29,12 @@ jobs:
2429 steps :
2530
2631 - name : Get the code
27- uses : actions/checkout@v3
32+ uses : actions/checkout@v4
2833
2934 # Install/cache OpenJDK
3035 - name : Cache OpenJDK
3136 id : cache-openjdk
32- uses : actions/cache@v3
37+ uses : actions/cache@v4
3338 with :
3439 path : /usr/lib/jvm/java-11-openjdk-amd64
3540 key : ${{ runner.os }}-openjdk-11
4247 # Install/cache Nextflow
4348 - name : Cache Nextflow
4449 id : cache-nextflow
45- uses : actions/cache@v3
50+ uses : actions/cache@v4
4651 with :
4752 path : /usr/local/bin/nextflow
4853 key : ${{ runner.os }}-nextflow
@@ -51,22 +56,32 @@ jobs:
5156 - name : Install Nextflow
5257 if : ${{ steps.cache-nextflow.outputs.cache-hit != 'true' }}
5358 run : cat .github/workflows/install_nextflow_v24.10.5.sh | bash && mv nextflow /usr/local/bin && chmod +x /usr/local/bin/nextflow
59+
60+ # Check-out the repo under $GITHUB_WORKSPACE so that the job can access it
61+ - uses : actions/checkout@v4
5462
55- # Build/cache containers
56- - name : Cache containers
57- id : cache-containers
58- uses : actions/cache@v3
63+ - name : Cache Dockerfiles and TAR
64+ id : cache-dockerfiles
65+ uses : actions/cache@v4
5966 with :
60- key : ${{ runner.os }}-containers
61- path : /var/lib/docker/overlay2
62- restore-keys : |
63- ${{ runner.os }}-containers
64- - name : Build Containers
65- if : ${{ steps.cache-containers.outputs.cache-hit != 'true'}}
66- run : bash build_all.sh
67+ path : docker-images.tar
68+ key : ${{ runner.os }}-dockerfiles-${{ hashFiles('docker/**/*') }}
6769
68- # Check-out the repo under $GITHUB_WORKSPACE so that the job can access it
69- - uses : actions/checkout@v3
70+ - name : Load cached Docker images
71+ id : load-cache
72+ run : |
73+ if [ -f docker-images.tar ]; then
74+ echo "Loading cached Docker images..."
75+ docker load -i docker-images.tar || true
76+ echo "build=false" >> $GITHUB_ENV
77+ else
78+ echo "No Docker cache found"
79+ echo "build=true" >> $GITHUB_ENV
80+ fi
81+
82+ - name : Build images
83+ if : env.build == 'true' || steps.cache-dockerfiles.outputs.cache-hit != 'true'
84+ run : bash build_images.sh github_action
7085
7186 # Run test(s)
7287 - name : test short single
0 commit comments