From a70411fd1d4c76b252d452a02807e14f593333f1 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Thu, 7 Nov 2024 16:40:19 -0700 Subject: [PATCH 1/2] Exclude more paths from colmena.src to reduce rebuilds --- .srcignore | 18 ++++++++++++++++++ package.nix | 18 ++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 .srcignore diff --git a/.srcignore b/.srcignore new file mode 100644 index 0000000..d104ee6 --- /dev/null +++ b/.srcignore @@ -0,0 +1,18 @@ +# Exclusions from source distribution +# +# Files listed here will not be part of colmena.src + +/.github +/CNAME +/renovate.json + +/manual +/integration-tests + +/nix +/default.nix +/flake-compat.nix +/package.nix +/shell.nix + +# vim: set ft=gitignore: diff --git a/package.nix b/package.nix index a4b4b9f..c0379ec 100644 --- a/package.nix +++ b/package.nix @@ -1,18 +1,16 @@ -{ lib, stdenv, rustPlatform, installShellFiles, nix-eval-jobs }: +{ lib +, stdenv +, rustPlatform +, nix-gitignore +, installShellFiles +, nix-eval-jobs +}: rustPlatform.buildRustPackage rec { pname = "colmena"; version = "0.5.0-pre"; - src = lib.cleanSourceWith { - filter = name: type: !(type == "directory" && builtins.elem (baseNameOf name) [ - ".github" - "target" - "manual" - "integration-tests" - ]); - src = lib.cleanSource ./.; - }; + src = nix-gitignore.gitignoreSource [ ./.srcignore ] ./.; cargoLock = { lockFile = ./Cargo.lock; From ce1aa41ff402c4d2f1e22ebf4ba11c1814edee43 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Thu, 7 Nov 2024 17:08:49 -0700 Subject: [PATCH 2/2] .github: Run workflows on push event only --- .github/workflows/build.yml | 1 - .github/workflows/linters.yml | 1 - .github/workflows/tests.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6af53b5..e60ab05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,5 @@ name: Build on: - pull_request: push: jobs: build: diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index efb1a4b..0b103da 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,7 +1,6 @@ name: Linters on: - pull_request: push: jobs: linters: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fbc5e5a..6974925 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,5 @@ name: Tests on: - pull_request: push: jobs: tests: