From 63ab222a6afea8161a90f9921165d326bebbfdfd Mon Sep 17 00:00:00 2001 From: 0xgleb Date: Thu, 29 May 2025 23:29:20 +0400 Subject: [PATCH 1/2] fix ci --- .github/workflows/publish.yml | 33 ++++++++++++++++++++++----------- .github/workflows/rainix.yaml | 4 ++-- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a8e238d..4f5d13f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,17 +3,17 @@ on: workflow_dispatch: inputs: version-level: - description: 'Select Version Level' + description: "Select Version Level" required: true type: choice options: - - alpha # Increase the alpha pre-version (x.y.z-alpha.M) - - beta # Increase the beta pre-version (x.y.z-beta.M) - - patch # Increase the patch version (x.y.z) - - minor # Increase the minor version (x.y.0) - - major # Increase the major version (x.0.0) + - alpha # Increase the alpha pre-version (x.y.z-alpha.M) + - beta # Increase the beta pre-version (x.y.z-beta.M) + - patch # Increase the patch version (x.y.z) + - minor # Increase the minor version (x.y.0) + - major # Increase the major version (x.0.0) - release # Remove the pre-version, ie remove alpha/beta/rc (x.y.z) - - rc # Increase the rc pre-version (x.y.z-rc.M) + - rc # Increase the rc pre-version (x.y.z-rc.M) jobs: release: @@ -24,11 +24,22 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main + - uses: nixbuild/nix-quick-install-action@v30 with: - determinate: true - - uses: DeterminateSystems/flakehub-cache-action@main + nix_conf: | + keep-env-derivations = true + keep-outputs = true + - name: Restore and save Nix store + uses: nix-community/cache-nix-action@v6 + with: + # restore and save a cache using this key + primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} + # if there's no cache hit, restore a cache by this prefix + restore-prefixes-first-match: nix-${{ runner.os }}- + # collect garbage until the Nix store size (in bytes) is at most this number + # before trying to save a new cache + # 1G = 1073741824 + gc-max-store-size-linux: 1G - run: | git config --global user.email "${{ secrets.CI_GIT_EMAIL }}" diff --git a/.github/workflows/rainix.yaml b/.github/workflows/rainix.yaml index a9c4eb9..8af2854 100644 --- a/.github/workflows/rainix.yaml +++ b/.github/workflows/rainix.yaml @@ -24,7 +24,7 @@ jobs: - name: Install Nix uses: DeterminateSystems/nix-installer-action@v4 - - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: DeterminateSystems/flakehub-cache-action@main - run: nix develop --command rainix-rs-prelude - name: Run ${{ matrix.task }} @@ -34,4 +34,4 @@ jobs: run: nix develop --command ${{ matrix.task }} - name: Build for wasm target - run: nix develop -c cargo build --target wasm32-unknown-unknown \ No newline at end of file + run: nix develop -c cargo build --target wasm32-unknown-unknown From 2d53edf27e472da37aee085b7fc3aa55395dbb1a Mon Sep 17 00:00:00 2001 From: 0xgleb Date: Thu, 29 May 2025 23:41:25 +0400 Subject: [PATCH 2/2] add concurrency config and fix the fix --- .github/workflows/rainix.yaml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rainix.yaml b/.github/workflows/rainix.yaml index 8af2854..0296934 100644 --- a/.github/workflows/rainix.yaml +++ b/.github/workflows/rainix.yaml @@ -1,6 +1,10 @@ name: Rainix CI on: [push] +concurrency: + group: ${{ github.ref }}-rainix + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: standard-tests: strategy: @@ -22,9 +26,22 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v4 - - uses: DeterminateSystems/flakehub-cache-action@main + - uses: nixbuild/nix-quick-install-action@v30 + with: + nix_conf: | + keep-env-derivations = true + keep-outputs = true + - name: Restore and save Nix store + uses: nix-community/cache-nix-action@v6 + with: + # restore and save a cache using this key + primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} + # if there's no cache hit, restore a cache by this prefix + restore-prefixes-first-match: nix-${{ runner.os }}- + # collect garbage until the Nix store size (in bytes) is at most this number + # before trying to save a new cache + # 1G = 1073741824 + gc-max-store-size-linux: 1G - run: nix develop --command rainix-rs-prelude - name: Run ${{ matrix.task }}