Nixpkgs testing and building fixed. #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nix Build | |
| on: | |
| push: | |
| paths: | |
| - '**.nix' | |
| - 'flake.lock' | |
| - 'auto-cpufreq/Cargo.toml' | |
| - 'auto-cpufreq/Cargo.lock' | |
| - '.github/workflows/build-nix.yaml' | |
| pull_request: | |
| paths: | |
| - '**.nix' | |
| - 'flake.lock' | |
| - 'auto-cpufreq/Cargo.toml' | |
| - 'auto-cpufreq/Cargo.lock' | |
| jobs: | |
| nix_build: | |
| name: Nix Build - ${{ matrix.package }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| package: | |
| - auto-cpufreq | |
| - auto-cpufreq-gui | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v25 | |
| with: | |
| extra_nix_config: | | |
| experimental-features = nix-command flakes | |
| - name: Check Nix flake | |
| run: nix flake check | |
| - name: Build package | |
| run: nix build .#${{ matrix.package }} -L | |
| - name: Show build result | |
| run: | | |
| ls -lh result/ | |
| nix path-info ./result | |
| - name: Test binary | |
| run: | | |
| ./result/bin/auto-cpufreq --version || true | |
| ./result/bin/auto-cpufreq --help | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nix-${{ matrix.package }} | |
| path: result/bin/* | |
| nix_devshell: | |
| name: Test Nix devShell | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v25 | |
| with: | |
| extra_nix_config: | | |
| experimental-features = nix-command flakes | |
| - name: Enter dev shell and build | |
| run: | | |
| nix develop -c cargo --version | |
| nix develop -c rustc --version | |
| nix develop -c bash -c 'cd auto-cpufreq && cargo build --release' | |
| - name: Test in dev shell | |
| run: nix develop -c bash -c 'cd auto-cpufreq && cargo test' | |
| continue-on-error: true | |
| nix_module_test: | |
| name: Test NixOS module | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v25 | |
| with: | |
| extra_nix_config: | | |
| experimental-features = nix-command flakes | |
| - name: Evaluate NixOS module options via flake | |
| run: nix eval .#nixosModules.auto-cpufreq --apply builtins.typeOf | |
| continue-on-error: true | |
| traditional_nix_build: | |
| name: Traditional Nix build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v25 | |
| - name: Build with nix-build | |
| run: nix-build -I nixpkgs=channel:nixos-unstable nix/default.nix | |
| - name: Test binary | |
| run: | | |
| ./result/bin/auto-cpufreq --version || true | |
| ./result/bin/auto-cpufreq --help |