mirror of
https://github.com/versia-pub/activitypub.git
synced 2025-12-06 14:48:19 +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:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nix-matrix:
|
check:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-22.04
|
||||||
outputs:
|
permissions:
|
||||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
id-token: "write"
|
||||||
|
contents: "read"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- uses: cachix/install-nix-action@v24
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
- id: set-matrix
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
name: Generate Nix Matrix
|
- uses: DeterminateSystems/flake-checker-action@main
|
||||||
run: |
|
- name: Run `nix build`
|
||||||
set -Eeu
|
run: nix build .
|
||||||
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 }}"
|
|
||||||
15
flake.nix
15
flake.nix
|
|
@ -3,28 +3,19 @@
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
|
|
||||||
systems.url = "github:nix-systems/default";
|
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
|
# Dev tools
|
||||||
treefmt-nix.url = "github:numtide/treefmt-nix";
|
treefmt-nix.url = "github:numtide/treefmt-nix";
|
||||||
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs:
|
outputs = inputs@{ flake-parts, ... }:
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
systems = import inputs.systems;
|
systems = import inputs.systems;
|
||||||
imports = [
|
imports = [
|
||||||
inputs.treefmt-nix.flakeModule
|
inputs.treefmt-nix.flakeModule
|
||||||
];
|
];
|
||||||
flake = { config, self', inputs', ... }: {
|
|
||||||
githubActions = inputs.nix-github-actions.lib.mkGithubMatrix { checks = self'.packages; };
|
|
||||||
};
|
|
||||||
perSystem = { config, self', pkgs, lib, system, ... }:
|
perSystem = { config, self', pkgs, lib, system, ... }:
|
||||||
let
|
let
|
||||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||||
|
|
@ -36,8 +27,12 @@
|
||||||
name = "rust-toolchain";
|
name = "rust-toolchain";
|
||||||
paths = [ pkgs.rustc pkgs.cargo pkgs.cargo-watch pkgs.rust-analyzer pkgs.rustPlatform.rustcSrc ];
|
paths = [ pkgs.rustc pkgs.cargo pkgs.cargo-watch pkgs.rust-analyzer pkgs.rustPlatform.rustcSrc ];
|
||||||
};
|
};
|
||||||
|
checks = {
|
||||||
|
x86_64-linux.default = config.packages.default;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
githubActions = inputs.nix-github-actions.lib.mkGithubMatrix { inherit checks; };
|
||||||
# Rust package
|
# Rust package
|
||||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
||||||
inherit (cargoToml.package) name version;
|
inherit (cargoToml.package) name version;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue