Skip to content

Commit

Permalink
lol
Browse files Browse the repository at this point in the history
  • Loading branch information
cole-h committed Aug 30, 2024
1 parent b5a094c commit 09a53c0
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 45 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
strategy:
matrix:
systems:
- nix-system: x86_64-linux
system: X64-Linux
runner: ubuntu-22.04
- nix-system: aarch64-linux
system: ARM64-Linux
runner: namespace-profile-default-arm64
- nix-system: x86_64-darwin
system: X64-macOS
runner: macos-12
# - nix-system: x86_64-linux
# system: X64-Linux
# runner: ubuntu-22.04
# - nix-system: aarch64-linux
# system: ARM64-Linux
# runner: namespace-profile-default-arm64
# - nix-system: x86_64-darwin
# system: X64-macOS
# runner: macos-12
- nix-system: aarch64-darwin
system: ARM64-macOS
runner: macos-latest-xlarge
Expand All @@ -41,6 +41,7 @@ jobs:
- name: Build package and create closure for ${{ matrix.systems.system }}
run: |
ulimit -a
nix build .# -L --fallback && \
nix-store --export $(nix-store -qR ./result) | xz -9 > "${{ env.ARCHIVE_NAME }}"
Expand Down
48 changes: 12 additions & 36 deletions .github/workflows/check-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,8 @@ on:
branches: [main]

jobs:
checks:
name: Nix and Rust checks
runs-on: ubuntu-22.04
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3

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

- name: Check health of flake.lock
uses: DeterminateSystems/flake-checker-action@main
# TODO: re-enable fail mode when we find a way to bump Nixpkgs to 24.05
# without breaking the static Rust build
#with:
# fail-mode: true

- name: Check Rust formatting
run: nix develop --command cargo fmt --check

- name: Clippy
run: nix develop --command cargo clippy

build:
name: Build artifacts
needs: checks
uses: ./.github/workflows/build.yaml
secrets: inherit

Expand All @@ -48,12 +21,12 @@ jobs:
strategy:
matrix:
systems:
- system: X64-Linux
runner: ubuntu-22.04
- system: ARM64-Linux
runner: namespace-profile-default-arm64
- system: X64-macOS
runner: macos-12
# - system: X64-Linux
# runner: ubuntu-22.04
# - system: ARM64-Linux
# runner: namespace-profile-default-arm64
# - system: X64-macOS
# runner: macos-12
- system: ARM64-macOS
runner: macos-latest-xlarge
permissions:
Expand All @@ -74,6 +47,7 @@ jobs:
- name: Test magic-nix-cache-action@main on ${{ matrix.systems.runner }}
uses: DeterminateSystems/magic-nix-cache-action@main
with:
use-gha-cache: false
source-binary: "${{ env.ARTIFACT_KEY }}/${{ env.ARCHIVE_NAME }}"
_internal-strict-mode: true

Expand All @@ -82,7 +56,9 @@ jobs:
nix develop --command echo "just testing"
- name: Exhaust our GitHub Actions Cache tokens
# Generally skip this step since it is so intensive
if: ${{ false }}
# if: ${{ false }}
run: |
date >> README.md
nix build .#veryLongChain -v
ulimit -n
# date >> README.md
# nix build .#veryLongChain -v
nix build .#veryWideNet -v
35 changes: 35 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,43 @@
in
# Starting point of the chain
createChain 200 startFile;

veryWideNet =
let
ctx = ./README.md;

# Function to write the current date to a file
startFile =
pkgs.stdenv.mkDerivation {
name = "start-file";
buildCommand = ''
cat ${ctx} > $out
'';
};

# Recursive function to create a chain of derivations
createNet = n: startFile:
pkgs.stdenv.mkDerivation {
name = "net-${toString n}";
src = startFile;
buildCommand = ''
echo $src > $out
'';
};

in
pkgs.stdenv.mkDerivation {
name = "net";
src = startFile;
buildCommand = ''
echo $src > $out
'';

buildInputs = builtins.genList (x: createNet x startFile) 2000;
};
});


devShells = forEachSupportedSystem ({ system, pkgs, lib }:
let
toolchain = fenixToolchain system;
Expand Down

0 comments on commit 09a53c0

Please sign in to comment.