From e8fd44d061aa21c8812b27f1d2d5c3953b29894a Mon Sep 17 00:00:00 2001 From: Fabio Seel Date: Thu, 10 Oct 2024 16:07:09 +0200 Subject: [PATCH] fix: screw reusable actions, hopefully it runs now --- .github/workflows/code_check.yml | 30 +++++++++++++++++------ .github/workflows/config_scan.yml | 27 +++++++++++++++------ .github/workflows/get_singularity.yml | 35 --------------------------- 3 files changed, 42 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/get_singularity.yml diff --git a/.github/workflows/code_check.yml b/.github/workflows/code_check.yml index f826811b..3c61a875 100644 --- a/.github/workflows/code_check.yml +++ b/.github/workflows/code_check.yml @@ -8,17 +8,31 @@ on: branches: - main -jobs: - init: - uses: ./.github/workflows/get_singularity.yml - with: - singularity_image: oras://ghcr.io/berenslab/retinal-rl:singularity-image-latest - sif_file: retinal-rl_singularity-image-latest.sif +env: + singularity_image: oras://ghcr.io/berenslab/retinal-rl:singularity-image-latest + sif_file: retinal-rl_singularity-image-latest.sif - lint: - needs: init +jobs: + check: runs-on: ubuntu-latest steps: + - name: Setup Apptainer + uses: eWaterCycle/setup-apptainer@v2 + with: + apptainer-version: 1.3.0 + - name: Cache Singularity Image + id: cache-singularity + uses: actions/cache@v3 + with: + path: ~/${{ env.sif_file }} + key: ${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }} + - name: Pull Singularity container + if: steps.cache-singularity.outputs.cache-hit != 'true' + run: | + singularity registry login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} oras://ghcr.io + singularity pull ${{ env.sif_file }} ${{ env.singularity_image }} + + - name: Checkout code uses: actions/checkout@v4 with: diff --git a/.github/workflows/config_scan.yml b/.github/workflows/config_scan.yml index 51e5df4b..2978c3cc 100644 --- a/.github/workflows/config_scan.yml +++ b/.github/workflows/config_scan.yml @@ -1,17 +1,30 @@ name: Scan Configs on: [pull_request,workflow_dispatch] -jobs: - init: - uses: ./.github/workflows/get_singularity.yml - with: - singularity_image: oras://ghcr.io/berenslab/retinal-rl:singularity-image-latest - sif_file: retinal-rl_singularity-image-latest.sif +env: + singularity_image: oras://ghcr.io/berenslab/retinal-rl:singularity-image-latest + sif_file: retinal-rl_singularity-image-latest.sif +jobs: scan: - needs: init runs-on: ubuntu-latest steps: + - name: Setup Apptainer + uses: eWaterCycle/setup-apptainer@v2 + with: + apptainer-version: 1.3.0 + - name: Cache Singularity Image + id: cache-singularity + uses: actions/cache@v3 + with: + path: ~/${{ env.sif_file }} + key: ${{ runner.os }}-singularity-${{ hashFiles('~/resources/retinal-rl.def') }} + - name: Pull Singularity container + if: steps.cache-singularity.outputs.cache-hit != 'true' + run: | + singularity registry login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} oras://ghcr.io + singularity pull ${{ env.sif_file }} ${{ env.singularity_image }} + - uses: actions/checkout@v4 - name: Scan classification config run: | diff --git a/.github/workflows/get_singularity.yml b/.github/workflows/get_singularity.yml deleted file mode 100644 index 411548ec..00000000 --- a/.github/workflows/get_singularity.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Get Singularity Container - -on: - workflow_call: - inputs: - singularity_image: - required: true - type: string - sif_file: - required: true - type: string - -jobs: - init: - runs-on: ubuntu-latest - steps: - - name: Setup Apptainer - uses: eWaterCycle/setup-apptainer@v2 - with: - apptainer-version: 1.3.0 - - - name: Cache Singularity Image - id: cache-singularity - uses: actions/cache@v3 - with: - path: ~/singularity_images - key: ${{ runner.os }}-singularity-${{ hashFiles('**/singularity_image_url.txt') }} - - - name: Pull Singularity container - if: steps.cache-singularity.outputs.cache-hit != 'true' - run: | - mkdir -p ~/singularity_images - singularity registry login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} oras://ghcr.io - singularity pull --dir ~/singularity_images ${{ inputs.sif_file }} ${{ inputs.singularity_image }} - echo "${{ inputs.singularity_image }}" > ~/singularity_images/singularity_image_url.txt \ No newline at end of file