diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 992dce7..618b0dc 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -37,7 +37,9 @@ jobs: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.ref }} + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -86,7 +88,9 @@ jobs: # Setup repo and add caching - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.ref }} + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Run integration tests run: earthly --ci -P ./integration-tests+all @@ -125,7 +129,9 @@ jobs: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.ref }} + fetch-depth: 0 + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} - name: Install bluebuild run: | diff --git a/integration-tests/test-repo/recipes/akmods.yml b/integration-tests/test-repo/recipes/akmods.yml index 06078bd..e8053aa 100644 --- a/integration-tests/test-repo/recipes/akmods.yml +++ b/integration-tests/test-repo/recipes/akmods.yml @@ -2,16 +2,16 @@ modules: # Tests installing rpms from a combo image stage + - type: akmods + install: + - nct6687d + - openrazer + - openrgb + + # Tests pulling surface image - type: akmods base: surface nvidia: true - # install: - # - nvidia - # - openrazer - # - openrgb - - # Tests pulling main image - - type: akmods # Tests pulling image for main nvidia - type: akmods @@ -20,3 +20,4 @@ modules: # Test pulling image for base asus - type: akmods base: asus + nvidia: true diff --git a/integration-tests/test-repo/recipes/recipe.yml b/integration-tests/test-repo/recipes/recipe.yml index 1771dab..a98bb5d 100644 --- a/integration-tests/test-repo/recipes/recipe.yml +++ b/integration-tests/test-repo/recipes/recipe.yml @@ -1,6 +1,6 @@ name: cli/test description: This is my personal OS image. -base-image: ghcr.io/ublue-os/silverblue-surface +base-image: ghcr.io/ublue-os/silverblue-main image-version: 39 modules: - from-file: akmods.yml diff --git a/recipe/src/akmods_info.rs b/recipe/src/akmods_info.rs index b132f83..3d5b11d 100644 --- a/recipe/src/akmods_info.rs +++ b/recipe/src/akmods_info.rs @@ -2,6 +2,6 @@ use typed_builder::TypedBuilder; #[derive(Debug, Clone, TypedBuilder, PartialEq, Eq, Hash)] pub struct AkmodsInfo { - pub images: (String, Option), + pub images: (String, String, Option), pub stage_name: String, } diff --git a/recipe/src/module.rs b/recipe/src/module.rs index b50778d..003cae1 100644 --- a/recipe/src/module.rs +++ b/recipe/src/module.rs @@ -120,22 +120,34 @@ impl<'a> Module<'a> { .images(match (base, nvidia) { (Some(b), NvidiaAkmods::Nvidia(nv)) if !b.is_empty() && nv => ( format!("akmods:{b}-{os_version}"), + format!("akmods-extra:{b}-{os_version}"), Some(format!("akmods-nvidia:{b}-{os_version}")), ), (Some(b), NvidiaAkmods::Version(nv)) if !b.is_empty() && nv > 0 => ( format!("akmods:{b}-{os_version}"), + format!("akmods-extra:{b}-{os_version}"), Some(format!("akmods-nvidia:{b}-{os_version}-{nv}")), ), - (Some(b), _) if !b.is_empty() => (format!("akmods:{b}-{os_version}"), None), + (Some(b), _) if !b.is_empty() => ( + format!("akmods:{b}-{os_version}"), + format!("akmods-extra:{b}-{os_version}"), + None, + ), (_, NvidiaAkmods::Nvidia(nv)) if nv => ( format!("akmods:main-{os_version}"), + format!("akmods-extra:main-{os_version}"), Some(format!("akmods-nvidia:main-{os_version}")), ), (_, NvidiaAkmods::Version(nv)) if nv > 0 => ( format!("akmods:main-{os_version}"), + format!("akmods-extra:main-{os_version}"), Some(format!("akmods-nvidia:main-{os_version}-{nv}")), ), - _ => (format!("akmods:main-{os_version}"), None), + _ => ( + format!("akmods:main-{os_version}"), + format!("akmods-extra:main-{os_version}"), + None, + ), }) .stage_name(format!( "{}{}", diff --git a/template/templates/modules/akmods/akmods.j2 b/template/templates/modules/akmods/akmods.j2 index 64bcc4c..3066d7b 100644 --- a/template/templates/modules/akmods/akmods.j2 +++ b/template/templates/modules/akmods/akmods.j2 @@ -1,7 +1,8 @@ {%- for info in recipe.modules_ext.get_akmods_info_list(os_version) %} FROM scratch as stage-akmods-{{ info.stage_name }} COPY --from=ghcr.io/ublue-os/{{ info.images.0 }} /rpms /rpms - {%- if let Some(nv_image) = info.images.1 %} +COPY --from=ghcr.io/ublue-os/{{ info.images.1 }} /rpms /rpms + {%- if let Some(nv_image) = info.images.2 %} COPY --from=ghcr.io/ublue-os/{{ nv_image }} /rpms /rpms {%- endif %} {%- endfor %}