Skip to content

Commit

Permalink
feat: update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
GTrunSec committed Nov 22, 2023
1 parent 179d785 commit 49b3445
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .github/actions/common-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Setup Environment
inputs:
CACHIX_AUTH_TOKEN:
required: true
description: "Cachix Auth Token"
SECRET_GITHUB_TOKEN:
required: true
description: "Github Secret Token"
runs:
using: "composite"
steps:
- uses: DeterminateSystems/nix-installer-action@main
with:
github_token: ${{ inputs.SECRET_GITHUB_TOKEN }}

- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: yaxitech/nix-install-pkgs-action@v3
with:
packages: "nixpkgs#nixci"
8 changes: 5 additions & 3 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@ on:
branches:
- main
jobs:
nix:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Setup
uses: ./.github/actions/common-setup
with:
SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Example/nixos
run: nix -Lv build ./local#eval.nixos.expr.nixosConfiguration.config.system.build.toplevel --dry-run
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "CI"
on:
pull_request:
push:
branches:
- main
jobs:
packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup
uses: ./.github/actions/common-setup
with:
SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: nixci
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
inherit (src) lib ops errors;

nixci.default = {
dir1.dir = "./local";
dir1.dir = "./local/ci";
};

templates = {
Expand Down
26 changes: 26 additions & 0 deletions local/ci/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions local/ci/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
description = "A very basic flake";

inputs.call-flake.url = "github:divnix/call-flake";

outputs =
{ self, call-flake }:
let
local = call-flake ../.;
inherit (local) examples;
in
{
packages.x86_64-linux = examples.packages.exports.derivations;
};
}

0 comments on commit 49b3445

Please sign in to comment.