Skip to content

Commit

Permalink
Add a nix build and cache action (#2)
Browse files Browse the repository at this point in the history
Currently the action builds `kadena-graph` and `kadena-cli`
  • Loading branch information
enobayram authored May 13, 2024
1 parent 9c2d1cd commit d3dd068
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and cache with Nix

on:
workflow_dispatch:
push:
paths:
- '**'

jobs:
build-and-cache:
runs-on: ${{ matrix.os }}
timeout-minutes: 740
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, macos-m1]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Nix with caching
uses: kadena-io/setup-nix-with-cache/[email protected]
with:
cache_url: s3://nixcache.chainweb.com?region=us-east-1
signing_private_key: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
additional_experimental_features: recursive-nix


- name: Set up AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.NIX_CACHE_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.NIX_CACHE_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Give root user AWS credentials
uses: kadena-io/setup-nix-with-cache/[email protected]

- name: Build and cache artifacts
run: |
echo Building the packages
nix build .#kadena-graph --log-lines 500 --show-trace
nix build .#kadena-cli --log-lines 500 --show-trace

0 comments on commit d3dd068

Please sign in to comment.