test nixcp

use nixcp to upload machines as result
This commit is contained in:
cy 2025-05-04 01:59:10 -04:00
parent 477d94687d
commit 5cb9e61708
2 changed files with 37 additions and 61 deletions

View file

@ -39,25 +39,6 @@ jobs:
- name: setup binary cache key
run: echo -n "${{ secrets.NIX_CACHE_SECRET_KEY }}" | xxd -p -r > ${{ runner.temp }}/cache-priv-key.pem
- name: Sync repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: post-build-hook
run: |
sudo mkdir -p /etc/nix
sudo cp ci/upload-to-cache.sh /etc/nix/
sudo chmod +x /etc/nix/upload-to-cache.sh
- name: setup s3 credentials
run: |
sudo mkdir /root/.aws
echo "[default]" |sudo tee /root/.aws/config |sudo tee /root/.aws/credentials
echo "aws_access_key_id=$AWS_ACCESS_KEY_ID" |sudo tee -a /root/.aws/credentials
echo "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" |sudo tee -a /root/.aws/credentials
echo "endpoint_url=$AWS_ENDPOINT_URL" |sudo tee -a /root/.aws/config
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
@ -70,13 +51,26 @@ jobs:
secret-key-files = ${{ runner.temp }}/cache-priv-key.pem
extra-substituters = https://nixcache.cy7.sh
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
post-build-hook = /etc/nix/upload-to-cache.sh
download-buffer-size = 1073741824
- name: Sync repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: build
run: |
nix run nixpkgs#nixos-rebuild build -- -L --flake ".#${{ matrix.machine }}"
- name: cache
run: |
nix run \
github:cything/nixcp/test-in-ci -- push \
--bucket nixcache \
--endpoint $AWS_ENDPOINT_URL \
--signing-key ${{ runner.temp }}/cache-priv-key.pem \
result
build-homes:
strategy:
fail-fast: false
@ -86,7 +80,6 @@ jobs:
- yt@chunk
os:
- ubuntu-latest
# - macos-latest
runs-on: ${{ matrix.os }}
steps:
@ -105,25 +98,6 @@ jobs:
- name: setup binary cache key
run: echo -n "${{ secrets.NIX_CACHE_SECRET_KEY }}" | xxd -p -r > ${{ runner.temp }}/cache-priv-key.pem
- name: Sync repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: post-build-hook
run: |
sudo mkdir -p /etc/nix
sudo cp ci/upload-to-cache.sh /etc/nix/
sudo chmod +x /etc/nix/upload-to-cache.sh
- name: setup s3 credentials
run: |
sudo mkdir /root/.aws
echo "[default]" |sudo tee /root/.aws/config |sudo tee /root/.aws/credentials
echo "aws_access_key_id=$AWS_ACCESS_KEY_ID" |sudo tee -a /root/.aws/credentials
echo "aws_secret_access_key=$AWS_SECRET_ACCESS_KEY" |sudo tee -a /root/.aws/credentials
echo "endpoint_url=$AWS_ENDPOINT_URL" |sudo tee -a /root/.aws/config
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
@ -136,10 +110,23 @@ jobs:
secret-key-files = ${{ runner.temp }}/cache-priv-key.pem
extra-substituters = https://nixcache.cy7.sh
extra-trusted-public-keys = nixcache.cy7.sh:DN3d1dt0wnXfTH03oVmTee4KgmdNdB0NY3SuzA8Fwx8=
post-build-hook = /etc/nix/upload-to-cache.sh
download-buffer-size = 1073741824
- name: Sync repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: build
run: |
package=".#homeConfigurations."${{ matrix.home }}".activationPackage"
nix build -L "$package"
- name: cache
run: |
nix run \
github:cything/nixcp/test-in-ci -- push \
--bucket nixcache \
--endpoint $AWS_ENDPOINT_URL \
--signing-key ${{ runner.temp }}/cache-priv-key.pem \
result