mirror of
https://github.com/versia-pub/activitypub.git
synced 2025-12-06 06:38:20 +01:00
awa
This commit is contained in:
parent
4d3657132d
commit
76d20cb2ef
33
.github/workflows/nix-flake.yml
vendored
33
.github/workflows/nix-flake.yml
vendored
|
|
@ -9,26 +9,15 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
nix-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
check:
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
id-token: "write"
|
||||
contents: "read"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v24
|
||||
- id: set-matrix
|
||||
name: Generate Nix Matrix
|
||||
run: |
|
||||
set -Eeu
|
||||
matrix="$(nix eval --json '.#githubActions.matrix')"
|
||||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
||||
|
||||
nix-build:
|
||||
needs: nix-matrix
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v24
|
||||
- run: nix build -L ".#${{ matrix.attr }}"
|
||||
- uses: actions/checkout@v3
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
- uses: DeterminateSystems/flake-checker-action@main
|
||||
- name: Run `nix build`
|
||||
run: nix build .
|
||||
15
flake.nix
15
flake.nix
|
|
@ -3,28 +3,19 @@
|
|||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
systems.url = "github:nix-systems/default";
|
||||
systems.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
nix-github-actions.url = "github:nix-community/nix-github-actions";
|
||||
nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
# Dev tools
|
||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs:
|
||||
outputs = inputs@{ flake-parts, ... }:
|
||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = import inputs.systems;
|
||||
imports = [
|
||||
inputs.treefmt-nix.flakeModule
|
||||
];
|
||||
flake = { config, self', inputs', ... }: {
|
||||
githubActions = inputs.nix-github-actions.lib.mkGithubMatrix { checks = self'.packages; };
|
||||
};
|
||||
perSystem = { config, self', pkgs, lib, system, ... }:
|
||||
let
|
||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||
|
|
@ -36,8 +27,12 @@
|
|||
name = "rust-toolchain";
|
||||
paths = [ pkgs.rustc pkgs.cargo pkgs.cargo-watch pkgs.rust-analyzer pkgs.rustPlatform.rustcSrc ];
|
||||
};
|
||||
checks = {
|
||||
x86_64-linux.default = config.packages.default;
|
||||
};
|
||||
in
|
||||
{
|
||||
githubActions = inputs.nix-github-actions.lib.mkGithubMatrix { inherit checks; };
|
||||
# Rust package
|
||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
||||
inherit (cargoToml.package) name version;
|
||||
|
|
|
|||
Loading…
Reference in a new issue