Skip to content

Commit

Permalink
Merge pull request #30 from berenslab/fix-ci-pipeline
Browse files Browse the repository at this point in the history
Fix ci pipeline
  • Loading branch information
fabioseel authored Oct 21, 2024
2 parents 77c8ace + c23c34f commit 6d9d4a9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/code_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ jobs:

- name: Cache Singularity Image
id: cache-singularity
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: ${{ env.sif_file }}
key: ${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
restore-keys: |
${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
key: ${{ runner.os }}-singularity-${{ hashFiles('resources/retinal-rl.def') }}

- name: Run Linter / Code check
if: always() && steps.cache-singularity.outputs.cache-hit == 'true'
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/container_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.3.0

- name: Cache Singularity Image
id: cache-singularity
uses: actions/cache@v4
with:
path: ${{ env.sif_file }}
key: ${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
restore-keys: |
${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
key: ${{ runner.os }}-singularity-${{ hashFiles('resources/retinal-rl.def') }}

- name: Build Singularity container
if: steps.cache-singularity.outputs.cache-hit != 'true'
run: apptainer build ${{ env.sif_file }} resources/retinal-rl.def

- name: Show Versions
run: apptainer exec retinal-rl_singularity-image.sif pip freeze
11 changes: 7 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:

- name: Setup Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.3.0
- name: Retrieve cached sif file
id: cache-singularity
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: ${{ env.sif_file }}
key: ${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
restore-keys: |
${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
key: ${{ runner.os }}-singularity-${{ hashFiles('resources/retinal-rl.def') }}
- name: Deployment / Push to ghcr.io
run: |
apptainer registry login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} oras://ghcr.io
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
less $GITHUB_OUTPUT
ensure_container: # main cache should provide the container if def file not changed
name: Rebuild container
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.sif_file }}
key: ${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
restore-keys: |
${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }}
key: ${{ runner.os }}-singularity-${{ hashFiles('resources/retinal-rl.def') }}
- name: Pull Singularity container
if: steps.cache-singularity.outputs.cache-hit != 'true'
run: apptainer pull ${{ env.sif_file }} ${{ env.singularity_image }}
- name: Show Versions
run: apptainer exec retinal-rl_singularity-image.sif pip freeze

0 comments on commit 6d9d4a9

Please sign in to comment.