From ff33cc4dadc9f84ac2486d49c1da5990753a1d2d Mon Sep 17 00:00:00 2001 From: vssukharev Date: Mon, 6 Jan 2025 19:57:16 +0200 Subject: [PATCH] Add Nix build and checks to CI/CD --- .github/workflows/main.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3135369fb..215457d85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -703,6 +703,36 @@ jobs: name: c3-macos-${{matrix.build_type}} path: c3-macos-${{matrix.build_type}}.zip + build-nix: + runs-on: ubuntu-latest + strategy: + # Don't abort runners if a single one fails + fail-fast: false + matrix: + build_type: [ Release, Debug ] + nixpkgs: [ Lock, Latest ] + steps: + - uses: actions/checkout@v4 + + - name: Install Nix + uses: cachix/install-nix-action@v30 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Update flake (if necessary) + run: | + if [[ matrix.nixpkgs == "Latest" ]]; then + nix flake update + fi + nix flake info + + - name: Build and check + run: | + if [[ ${{ matrix.build_type }} = "Debug" ]]; then + nix build -L ".#c3c-debug-checks" + else + nix build -L ".#c3c-checks" + fi release: runs-on: ubuntu-latest