Fix CI/CD
This commit is contained in:
parent
f72cc0c9aa
commit
9b5b7be0de
2 changed files with 21 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
10
flake.nix
10
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue