Skip to content

nix-build

nix-build #2109

Workflow file for this run

name: "nix-build"
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
branches:
- 'master'
push:
branches:
- main
- master
schedule:
# rebuild everyday at 2:51
# TIP: Choose a random time here so not all repositories are build at once:
# https://www.random.org/clock-times/?num=1&earliest=01%3A00&latest=08%3A00&interval=5&format=html&rnd=new
- cron: '50 5 * * *'
workflow_dispatch:
jobs:
nix-build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
cachixName:
- pkgs
- some-unfree
nurRepo:
- some-pkgs
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
if: ${{ matrix.cachixName == 'pkgs' }}
uses: DeterminateSystems/nix-installer-action@v14
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
extra-substituters = https://pkgs.cachix.org
extra-trusted-public-keys = pkgs.cachix.org-1:/fnDPhnDwMjJA8IXJl+eAJmnU3n/jgfgvb6SZGuq4gs=
- name: Install Nix (with unfree substituters)
if: ${{ matrix.cachixName == 'some-unfree' }}
uses: DeterminateSystems/nix-installer-action@v14
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
extra-substituters = https://some-unfree.cachix.org https://cuda-maintainers.cachix.org https://pkgs.cachix.org
extra-trusted-public-keys = some-unfree.cachix.org-1:2/+ag/3nMOroWbHV2UXRuxo9c2VkVb6mUUy7sCXDe1Y= cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E= pkgs.cachix.org-1:/fnDPhnDwMjJA8IXJl+eAJmnU3n/jgfgvb6SZGuq4gs=
- uses: DeterminateSystems/magic-nix-cache-action@v8
with:
upstream-cache: https://${{ matrix.cachixName }}.cachix.org
- name: Setup pkgs.cachix.org
if: ${{ matrix.cachixName == 'pkgs' }}
uses: cachix/cachix-action@v15
with:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
name: ${{ matrix.cachixName }}
- name: Setup some-unfree.cachix.org
if: ${{ matrix.cachixName == 'some-unfree' }}
uses: cachix/cachix-action@v15
with:
authToken: '${{ secrets.CACHIX_AUTH_TOKEN_UNFREE }}'
name: ${{ matrix.cachixName }}
- name: Show nixpkgs version
run: nix eval nixpkgs#lib.version
- name: Build some-pkgs
if: ${{ matrix.cachixName == 'pkgs' }}
run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#legacyPackages.$(nix eval --raw --impure --expr builtins.currentSystem).pkgs.some-pkgs"
- name: Build some-pkgs-py
if: ${{ matrix.cachixName == 'pkgs' }}
run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#legacyPackages.$(nix eval --raw --impure --expr builtins.currentSystem).pkgs.some-pkgs-py"
- name: Build pkgsCuda.some-pkgs
if: ${{ matrix.cachixName == 'some-unfree' }}
run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#legacyPackages.$(nix eval --raw --impure --expr builtins.currentSystem).pkgsCuda.some-pkgs"
- name: Build pkgsCuda.some-pkgs-py
if: ${{ matrix.cachixName == 'some-unfree' }}
run: nix run github:Mic92/nix-fast-build -- --skip-cached --no-nom --flake ".#legacyPackages.$(nix eval --raw --impure --expr builtins.currentSystem).pkgsCuda.some-pkgs-py"
- name: Trigger NUR update
# Don't replace <YOUR_REPO_NAME> here!
if: ${{ matrix.nurRepo != '<YOUR_REPO_NAME>' }}
run: curl -XPOST "https://nur-update.nix-community.org/update?repo=${{ matrix.nurRepo }}"