Loading files
f3aa9354aThis file is pinned to the selected release. Download the original to open it in your design tool.
name: Build/Cache Nix
description: Builds default devShell for a platform, caching the results (if applicable)
inputs:
cachix_cache:
description: "The name of the Cachix cache to download to and/or upload from"
required: true
default: "openlane"
cachix_token:
description: "An authentication token for Cachix"
required: false
default: ""
shell:
description: "Shell to use"
required: true
default: "bash"
nix_system:
description: "The nix platform string to build for"
required: true
default: "x86_64-linux"
run_tests:
description: Whether to run unit tests and the smoke test
required: false
default: "false"
pdk_root:
description: "An optional override for the PDK root."
required: false
default: "$HOME/.volare"
runs:
using: "composite"
steps:
- id: Build
name: Build
shell: ${{ inputs.shell }}
run: |
echo "#################################################################"
outPath=$(nix build\
--print-out-paths\
--no-link\
--accept-flake-config\
--option system ${{ inputs.nix_system }}\
--extra-platforms ${{ inputs.nix_system }}\
.#devShells.${{ inputs.nix_system }}.default)
echo "out-path=$outPath" >> $GITHUB_OUTPUT
sudo du -hs /nix/store/* | sort -h | tail -n 20
- name: Smoke Test
shell: ${{ inputs.shell }}
if: inputs.run_tests == 'true'
run: |
echo "#################################################################"
nix run\
--option system ${{ inputs.nix_system }}\
--extra-platforms ${{ inputs.nix_system }}\
--accept-flake-config\
.#packages.${{ inputs.nix_system }}.openlane -- --pdk-root ${{ inputs.pdk_root }} --smoke-test
- name: Unit/Step Tests
shell: ${{ inputs.shell }}
if: inputs.run_tests == 'true'
run: |
echo "#################################################################"
nix develop\
--option system ${{ inputs.nix_system }}\
--extra-platforms ${{ inputs.nix_system }}\
--accept-flake-config\
.#devShells.${{ inputs.nix_system }}.dev --command\
pytest --step-rx '.' --pdk-root="${{ inputs.pdk_root }}" -n auto
- name: Install + Push to Cachix
shell: ${{ inputs.shell }}
if: ${{ inputs.cachix_token != '' }}
run: |
echo "#################################################################"
nix profile install cachix
cachix authtoken ${{ inputs.cachix_token }}
cachix push ${{ inputs.cachix_cache }} ${{ steps.build.outputs.out-path }}