Compare commits

..

No commits in common. "e4bc2d0740ba5068faa28bfaf92a91d98457e57d" and "f72cc0c9aa45548957281c0eadc04c2bdcfdb38f" have entirely different histories.

2 changed files with 19 additions and 28 deletions

View file

@ -14,28 +14,18 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Run unit tests - name: Run unit tests
run: nix build --print-build-logs .#checks.x86_64-linux.default run: nix develop --command cargo test --lib
build: build:
name: Build ${{ matrix.target }} name: Build ${{ matrix.package }}
runs-on: native runs-on: native
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: package:
- package: x86_64-linux - default
target: x86_64-unknown-linux-gnu - x86_64-linux-musl
- package: x86_64-linux-musl - aarch64-linux
target: x86_64-unknown-linux-musl
- package: aarch64-linux
target: aarch64-unknown-linux-gnu
# TODO: need macOS runners for these
# - package: default
# target: x86_64-apple-darwin
# system: x86_64-darwin
# - package: default
# target: aarch64-apple-darwin
# system: aarch64-darwin
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -44,14 +34,23 @@ jobs:
- name: Prepare release artifact - name: Prepare release artifact
if: startsWith(forgejo.ref, 'refs/tags/') if: startsWith(forgejo.ref, 'refs/tags/')
run: cp result/bin/mkv mkv-${{ matrix.target }} 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}"
- name: Upload artifact - name: Upload artifact
if: startsWith(forgejo.ref, 'refs/tags/') if: startsWith(forgejo.ref, 'refs/tags/')
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: mkv-${{ matrix.target }} name: mkv-${{ matrix.package }}
path: mkv-${{ matrix.target }} path: mkv-*
release: release:
name: Create release name: Create release

View file

@ -35,19 +35,11 @@
}; };
packages = { packages = {
default = mkv; default = mkv;
x86_64-linux = mkv;
} // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { } // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
x86_64-linux-musl = mkMkv pkgs.pkgsCross.musl64; x86_64-linux-musl = mkMkv pkgs.pkgsCross.musl64;
aarch64-linux = mkMkv pkgs.pkgsCross.aarch64-multiplatform; aarch64-linux = mkMkv pkgs.pkgsCross.aarch64-multiplatform;
}; };
checks.default = mkv.overrideAttrs { checks.default = mkv.overrideAttrs { doCheck = true; };
doCheck = true;
checkPhase = ''
runHook preCheck
cargo test --lib
runHook postCheck
'';
};
} }
); );
} }