mirror of
https://github.com/faas-rs/faasd-in-rust.git
synced 2025-06-08 07:55:04 +00:00
feat(ci): enable github action ci
This commit is contained in:
parent
3a513b525c
commit
35fb4a8232
32
.github/workflows/nix-github-actions.yml
vendored
Normal file
32
.github/workflows/nix-github-actions.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Nix Flake actions
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
nix-matrix:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v30
|
||||
- id: set-matrix
|
||||
name: Generate Nix Matrix
|
||||
run: |
|
||||
set -Eeu
|
||||
matrix="$(nix eval --json '.#githubActions.matrix')"
|
||||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
||||
|
||||
nix-build:
|
||||
name: ${{ matrix.name }} (${{ matrix.system }})
|
||||
needs: nix-matrix
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v30
|
||||
- run: nix build -L '.#${{ matrix.attr }}'
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2028,7 +2028,7 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
|
||||
|
||||
[[package]]
|
||||
name = "provider"
|
||||
version = "0.0.1"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"actix-service",
|
||||
"actix-web",
|
||||
|
@ -3,7 +3,7 @@ members = ["crates/*"]
|
||||
resolver = "3"
|
||||
|
||||
[workspace.package]
|
||||
version = "0.0.1"
|
||||
version = "0.1.0"
|
||||
authors = ["sparkzky", "Samuka007"]
|
||||
|
||||
[workspace.metadata.crane]
|
||||
|
35
flake.lock
generated
35
flake.lock
generated
@ -33,7 +33,39 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-github-actions": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737420293,
|
||||
"narHash": "sha256-F1G5ifvqTpJq7fdkT34e/Jy9VCyzd5XfJ9TO8fHhJWE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-github-actions",
|
||||
"rev": "f4158fa080ef4503c8f4c820967d946c2af31ec9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-github-actions",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1688646010,
|
||||
"narHash": "sha256-kCeza5eKI2NEi8k0EoeZfv3lN1r1Vwx+L/VA6I8tmG4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5daaa32204e9c46b05cd709218b7ba733d07e80c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1739866667,
|
||||
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
|
||||
@ -53,7 +85,8 @@
|
||||
"inputs": {
|
||||
"crane": "crane",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nix-github-actions": "nix-github-actions",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"rust-overlay": "rust-overlay"
|
||||
}
|
||||
},
|
||||
|
18
flake.nix
18
flake.nix
@ -5,13 +5,14 @@
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
crane.url = "github:ipetkov/crane";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nix-github-actions.url = "github:nix-community/nix-github-actions";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay, ... }:
|
||||
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay, nix-github-actions, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
# reference: https://crane.dev/examples/quick-start-workspace.html
|
||||
@ -32,12 +33,15 @@
|
||||
strictDeps = true;
|
||||
# Add additional build inputs here
|
||||
buildInputs = with pkgs; [
|
||||
openssl
|
||||
protobuf
|
||||
pkg-config
|
||||
];
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
openssl
|
||||
protobuf
|
||||
pkg-config
|
||||
];
|
||||
};
|
||||
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
||||
@ -55,6 +59,8 @@
|
||||
./Cargo.lock
|
||||
(craneLib.fileset.commonCargoSources ./crates/app)
|
||||
(craneLib.fileset.commonCargoSources ./crates/service)
|
||||
(craneLib.fileset.commonCargoSources ./crates/provider)
|
||||
(craneLib.fileset.commonCargoSources ./crates/cni)
|
||||
(craneLib.fileset.commonCargoSources ./crates/my-workspace-hack)
|
||||
(craneLib.fileset.commonCargoSources crate)
|
||||
];
|
||||
@ -140,5 +146,13 @@
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
)
|
||||
// {
|
||||
githubActions = nix-github-actions.lib.mkGithubMatrix {
|
||||
checks.x86_64-linux = self.checks.x86_64-linux;
|
||||
checks.x86_64-darwin.faas-rs-crate = self.checks.x86_64-darwin.faas-rs-crate;
|
||||
checks.aarch64-linux.faas-rs-crate = self.checks.aarch64-linux.faas-rs-crate;
|
||||
checks.aarch64-darwin.faas-rs-crate = self.checks.aarch64-darwin.faas-rs-crate;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user