From f9073a6184f61a07bb584ecc47fbb8eb997e9216 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 10 Oct 2023 11:21:25 +0300 Subject: [PATCH] nix: housekeeping (#100) * flake: bump inputs * CI: simplify cachix workflow * CI: separate nix flake checking --- .github/workflows/cachix.yml | 31 +++++++++++++++++++------------ .github/workflows/check.yml | 19 +++++++++++++++++++ flake.lock | 12 ++++++------ 3 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 0d34cc2..71edf72 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -2,16 +2,22 @@ name: "Set up binary cache & push binaries" on: workflow_dispatch: + pull_request: + branches: + - master + paths-ignore: + - .gitignore + - README.md push: branches: - master paths-ignore: - - .github/** - .gitignore - README.md jobs: cachix: + name: "Build Exposed Packages" runs-on: ubuntu-latest strategy: matrix: @@ -27,28 +33,29 @@ jobs: - symbols - websearch steps: - - uses: easimon/maximize-build-space@v6 + - uses: easimon/maximize-build-space@v8 with: overprovision-lvm: true remove-android: true remove-dotnet: true remove-haskell: true - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v22 - with: - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - auto-optimise-store = true - experimental-features = nix-command flakes - nix_path: nixpkgs=channel:nixos-unstable + remove-docker-images: true + remove-codeql: true + + - name: Checkout + uses: actions/checkout@v4 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: cachix/cachix-action@v12 with: authToken: ${{ secrets.CACHIX_TOKEN }} extraPullNames: nix-community name: anyrun + - name: Set default git branch (to reduce log spam) run: git config --global init.defaultBranch main - - name: Validate Flakes - run: nix flake check + - name: Build anyrun from the defined matrix run: nix build .#${{ matrix.package }} --print-build-logs diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..fb572d2 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,19 @@ +name: Flake Check + +on: [push, pull_request, workflow_dispatch] + +jobs: + check-flake: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + logger: pretty + + - name: Check Flake + run: nix flake check --accept-flake-config diff --git a/flake.lock b/flake.lock index 8c1f725..c6d5079 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1685662779, - "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1685655444, - "narHash": "sha256-6EujQNAeaUkWvpEZZcVF8qSfQrNVWFNNGbUJxv/A5a8=", + "lastModified": 1696193975, + "narHash": "sha256-mnQjUcYgp9Guu3RNVAB2Srr1TqKcPpRXmJf4LJk6KRY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e635192892f5abbc2289eaac3a73cdb249abaefd", + "rev": "fdd898f8f79e8d2f99ed2ab6b3751811ef683242", "type": "github" }, "original": {