ci: keep one core free when running flake check #14
This file contains 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: "Build and publish to Cachix and FlakeHub ❄️" | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
steps: | |
- name: Delete unnecessary tools folder | |
run: rm -rf /opt/hostedtoolcache | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install nix | |
uses: cachix/install-nix-action@v30 | |
- name: Setup cachix | |
uses: cachix/cachix-action@v14 | |
with: | |
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
name: polkadot | |
- name: Nix flake check | |
run: | | |
CORES=$(nproc) | |
CORES=$((CORES - 1)) | |
echo "Using $CORES cores." | |
nix flake check --max-jobs 1 --option cores $CORES | |
- name: Nix flake develop | |
run: nix develop | |
- name: Publish to FlakeHub | |
uses: DeterminateSystems/flakehub-push@main | |
with: | |
name: "andresilva/polkadot.nix" | |
rolling: true | |
visibility: public |