commit 9b5b7be0de389b59f9d70ed85fbc4246b69fae7e
parent f72cc0c9aa45548957281c0eadc04c2bdcfdb38f
Author: Silas Brack <silasbrack@gmail.com>
Date: Thu, 2 Apr 2026 23:35:15 +0200
Fix CI/CD
Diffstat:
2 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/.forgejo/workflows/ci.yaml b/.forgejo/workflows/ci.yaml
@@ -14,18 +14,21 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Run unit tests
- run: nix develop --command cargo test --lib
+ run: nix build --print-build-logs .#checks.x86_64-linux.default
build:
- name: Build ${{ matrix.package }}
+ name: Build ${{ matrix.target }}
runs-on: native
strategy:
fail-fast: false
matrix:
- package:
- - default
- - x86_64-linux-musl
- - aarch64-linux
+ include:
+ - package: x86_64-linux
+ target: x86_64-unknown-linux-gnu
+ - package: x86_64-linux-musl
+ target: x86_64-unknown-linux-musl
+ - package: aarch64-linux
+ target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
@@ -34,23 +37,14 @@ jobs:
- name: Prepare release artifact
if: startsWith(forgejo.ref, 'refs/tags/')
- run: |
- target="${{ matrix.package }}"
- if [ "$target" = "default" ]; then
- target="x86_64-unknown-linux-gnu"
- elif [ "$target" = "x86_64-linux-musl" ]; then
- target="x86_64-unknown-linux-musl"
- elif [ "$target" = "aarch64-linux" ]; then
- target="aarch64-unknown-linux-gnu"
- fi
- cp result/bin/mkv "mkv-${target}"
+ run: cp result/bin/mkv mkv-${{ matrix.target }}
- name: Upload artifact
if: startsWith(forgejo.ref, 'refs/tags/')
uses: actions/upload-artifact@v3
with:
- name: mkv-${{ matrix.package }}
- path: mkv-*
+ name: mkv-${{ matrix.target }}
+ path: mkv-${{ matrix.target }}
release:
name: Create release
diff --git a/flake.nix b/flake.nix
@@ -35,11 +35,19 @@
};
packages = {
default = mkv;
+ x86_64-linux = mkv;
} // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
x86_64-linux-musl = mkMkv pkgs.pkgsCross.musl64;
aarch64-linux = mkMkv pkgs.pkgsCross.aarch64-multiplatform;
};
- checks.default = mkv.overrideAttrs { doCheck = true; };
+ checks.default = mkv.overrideAttrs {
+ doCheck = true;
+ checkPhase = ''
+ runHook preCheck
+ cargo test --lib
+ runHook postCheck
+ '';
+ };
}
);
}