Skip to content

Commit

Permalink
Merge pull request #28 from FyraLabs/w/size-compression
Browse files Browse the repository at this point in the history
feat(ci): improve compression speed
  • Loading branch information
lleyton authored Sep 28, 2024
2 parents 28f245e + a0bf0e6 commit 5ccdd8e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
42 changes: 20 additions & 22 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,19 @@ jobs:
- name: Run test
run: |
export PATH=$HOME/.cargo/bin:$PATH
export KATSU_KEEP_CHROOT=1
pushd tests/ng
echo "COLORBT_SHOW_HIDDEN=1" >> .env
echo "KATSU_LOG=trace" >> .env
katsu -o disk-image katsu-arm.yaml 2>&1
xz -z9 katsu-work/image/katsu.img -c > katsu-work/image/katsu-arm.img.xz
zstd -19 katsu-work/image/katsu.img -c > katsu-work/image/katsu-arm.raw.zstd
popd
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: image-arm
path: tests/ng/katsu-work/image/*.img.xz
path: tests/ng/katsu-work/image/*.raw.zstd

image-x86_64:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -120,24 +121,24 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: Build and install katsu
run: |
cargo install --path . --debug
run: cargo install --path . --debug

- name: Run test
run: |
export PATH=$HOME/.cargo/bin:$PATH
export KATSU_KEEP_CHROOT=1
pushd tests/ng
echo "COLORBT_SHOW_HIDDEN=1" >> .env
echo "KATSU_LOG=trace" >> .env
katsu -o disk-image katsu.yaml 2>&1
xz -z9 katsu-work/image/katsu.img -c > katsu-work/image/katsu.raw.xz
zstd -19 katsu-work/image/katsu.img -c > katsu-work/image/katsu.raw.zstd
popd
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: image-x86_64
path: tests/ng/katsu-work/image/*.raw.xz
path: tests/ng/katsu-work/image/*.raw.zstd

iso-x86_64:
runs-on: ubuntu-latest
Expand All @@ -161,33 +162,32 @@ jobs:
dnf-
- name: Install dependencies
run: |
dnf install -y $DNF_PKGS
run: dnf install -y $DNF_PKGS

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- uses: Swatinem/rust-cache@v2

- name: Build and install katsu
run: |
cargo install --path . --debug
run: cargo install --path . --debug

- name: Run test
run: |
export PATH=$HOME/.cargo/bin:$PATH
export KATSU_KEEP_CHROOT=1
pushd tests/ng
echo "COLORBT_SHOW_HIDDEN=1" >> .env
echo "KATSU_LOG=trace" >> .env
katsu -o iso katsu-iso.yaml 2>&1
xz -z9 out.iso -c > katsu-work/image/katsu.iso.xz
mv out.iso katsu-work/image/katsu.iso
popd
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: iso-x86_64
path: tests/ng/katsu-work/image/*.iso.xz
path: tests/ng/katsu-work/image/katsu.iso

iso-limine-x86_64:
runs-on: ubuntu-latest
Expand All @@ -211,33 +211,32 @@ jobs:
dnf-
- name: Install dependencies
run: |
dnf install -y $DNF_PKGS
run: dnf install -y $DNF_PKGS

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- uses: Swatinem/rust-cache@v2

- name: Build and install katsu
run: |
cargo install --path . --debug
run: cargo install --path . --debug

- name: Run test
run: |
export PATH=$HOME/.cargo/bin:$PATH
export KATSU_KEEP_CHROOT=1
pushd tests/ng
echo "COLORBT_SHOW_HIDDEN=1" >> .env
echo "KATSU_LOG=trace" >> .env
katsu -o iso katsu-iso-limine.yaml 2>&1
xz -z9 out.iso -c > katsu-work/image/katsu.iso.xz
mv out.iso katsu-work/image/katsu.iso
popd
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: iso-limine-x86_64
path: tests/ng/katsu-work/image/*.iso.xz
path: tests/ng/katsu-work/image/katsu.iso

fs-test-x86_64:
runs-on: ubuntu-latest
Expand All @@ -261,21 +260,20 @@ jobs:
dnf-
- name: Install dependencies
run: |
dnf install -y $DNF_PKGS
run: dnf install -y $DNF_PKGS

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- uses: Swatinem/rust-cache@v2

- name: Build and install katsu
run: |
cargo install --path . --debug
run: cargo install --path . --debug

- name: Run test
run: |
export PATH=$HOME/.cargo/bin:$PATH
export KATSU_KEEP_CHROOT=1
pushd tests/ng
echo "COLORBT_SHOW_HIDDEN=1" >> .env
echo "KATSU_LOG=trace" >> .env
Expand Down
3 changes: 3 additions & 0 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ pub trait ImageBuilder {
) -> Result<()>;
}
/// Creates a disk image, then installs to it
#[allow(dead_code)]
pub struct DiskImageBuilder {
pub image: PathBuf,
pub bootloader: Bootloader,
Expand Down Expand Up @@ -500,6 +501,7 @@ impl ImageBuilder for DiskImageBuilder {
}

/// Installs directly to a device
#[allow(dead_code)]
pub struct DeviceInstaller {
pub device: PathBuf,
pub bootloader: Bootloader,
Expand All @@ -518,6 +520,7 @@ impl ImageBuilder for DeviceInstaller {
}

/// Installs as a raw chroot
#[allow(dead_code)]
pub struct FsBuilder {
pub bootloader: Bootloader,
pub root_builder: Box<dyn RootBuilder>,
Expand Down

0 comments on commit 5ccdd8e

Please sign in to comment.