-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (41 loc) · 1.44 KB
/
code_check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Code Checking & Scan
on:
workflow_dispatch:
workflow_call:
env:
singularity_image: oras://ghcr.io/berenslab/retinal-rl:singularity-image
sif_file: retinal-rl_singularity-image.sif
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch all branches
run: git fetch --all
- name: Setup Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.3.6
- name: Cache Singularity Image
id: cache-singularity
uses: actions/cache/restore@v4
with:
path: ${{ env.sif_file }}
key: ${{ runner.os }}-singularity-${{ hashFiles('resources/retinal-rl.def') }}
- name: Run Linter / Code check
if: always() && steps.cache-singularity.outputs.cache-hit == 'true'
run: bash tests/ci/lint.sh ${{ env.sif_file }}
- name: Scan configs
if: always() && steps.cache-singularity.outputs.cache-hit == 'true'
run: |
bash tests/ci/copy_configs.sh ${{ env.sif_file }}
bash tests/ci/scan_configs.sh ${{ env.sif_file }}
- name: Build Scenario
if: always() && steps.cache-singularity.outputs.cache-hit == 'true'
run: bash tests/ci/build_scenario.sh ${{ env.sif_file }}
- name: Pytest
if: always() && steps.cache-singularity.outputs.cache-hit == 'true'
run: apptainer exec ${{ env.sif_file }} pytest tests/modules