Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions integration #21

Open
zimbatm opened this issue Jun 30, 2024 · 1 comment
Open

GitHub Actions integration #21

zimbatm opened this issue Jun 30, 2024 · 1 comment

Comments

@zimbatm
Copy link
Member

zimbatm commented Jun 30, 2024

Output the build matrix so it integrates with GitHub Actions a bit like https://github.com/nix-community/nix-github-actions

@getchoo
Copy link

getchoo commented Jul 8, 2024

Just a suggestion, but maybe nix-fast-build could be used instead? When I first saw how checks are automatically created here, it instantly reminded me of it -- as that's how jobs are handled by default there as well

I think this would be pretty feasible given it's in nixpkgs as of NixOS/nixpkgs#313554, comes from a reputable member of the community, and would allow for simple workflows like this to work in any setup

name: CI

on:
  push:
    branches: [ main ]
  pull_request:
  workflow_dispatch:
  
jobs:
  build:
    name: Build flake outputs
    
    strategy:
      matrix:
        os: [ ubuntu-latest, macos-latest ]
        
    runs-on: ${{ matrix.os }}
    
    steps:
      - name: Checkout repository
         uses: actions/checkout@v4
         
      - name: Install Nix
        uses: cachix/install-nix-action@v27
        
      # Optional. See https://nix.dev/tutorials/nixos/continuous-integration-github-actions
      # - name: Setup Nix cache
      #   uses: cachix/cachix-action@v15
      
      - name: Run nix-fast-build
         run: |
           nix run \
             --inputs-from . \
             nixpkgs#nix-fast-build -- \
             --no-nom \
             --skip-cached

I've been using something similar with hydraJobs and flake-parts personally for a while now and it has worked wonders. A more simplistic approach like this would also probably make things easier to implement internally, and make things easier to reproduce locally for users (i.e., they can run nix-fast-build themselves to debug CI)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants