Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/flake-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Flake Check

on:
push:
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- "flake.lock"

jobs:
flake-check:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- msrv
- stable
- nightly
- maintenance
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Run full flake check
run: nix build .#checks.x86_64-linux.${{ matrix.checks }}
52 changes: 52 additions & 0 deletions .github/workflows/flake-maintenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Flake maintenance

on:
schedule:
- cron: "0 11 * * 1" # weekly at 14:00 UTC
workflow_dispatch:

jobs:
validate-lock-file:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- msrv
- stable
- nightly
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Validate recreated lockfile
run: nix build .#checks.x86_64-linux.${{ matrix.checks }} -L --recreate-lock-file --no-write-lock-file

update-lock-file:
needs: validate-lock-file
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main

- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
pr-title: "chore: update flake.lock"
commit-msg: "chore: update flake.lock"
token: ${{ secrets.GITHUB_TOKEN }}
nix-options: --offline
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ ohttp-relay = { path = "ohttp-relay" }
payjoin = { path = "payjoin" }
payjoin-directory = { path = "payjoin-directory" }
payjoin-test-utils = { path = "payjoin-test-utils" }

[profile.crane]
inherits = "test"
debug = false
17 changes: 16 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
inherit src;
strictDeps = true;

# avoid release builds throughout for faster feedback from checks
# note that this also affects the built packages
CARGO_PROFILE = "crane";

# provide fallback name & version for workspace related derivations
# this is mainly to silence warnings from crane about providing a stub
# value overridden in per-crate packages with info from Cargo.toml
Expand Down Expand Up @@ -217,10 +221,11 @@
partitions = 1;
partitionType = "count";
cargoExtraArgs = "--locked --all-features";
NEXTEST_SHOW_PROGRESS = "none";
BITCOIND_EXE = nixpkgs.lib.getExe' pkgs.bitcoind "bitcoind";
nativeBuildInputs = [ nginxWithStream ];
doInstallCargoArtifacts = false;
}

)
))
) craneLibVersions
Expand Down Expand Up @@ -304,6 +309,16 @@
]
++ pkgs.lib.attrValues packages
);

maintenance = checkSuite "maintenance" (
with self.outputs.checks.${system};
[
payjoin-workspace-machete
payjoin-workspace-clippy
payjoin-workspace-doc
formatting
]
);
};
}
);
Expand Down
Loading