Skip to content

Commit 85f3c0a

Browse files
mayastor-borstiagolobocastro
andcommitted
chore(bors): merge pull request #811
811: Fix helm pins on release branch (backport #809) r=tiagolobocastro a=mergify[bot] ## Description ## Motivation and Context ## Regression ## How Has This Been Tested? ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have added unit tests to cover my changes.<hr>This is an automatic backport of pull request #809 done by [Mergify](https://mergify.com). Co-authored-by: Tiago Castro <[email protected]>
2 parents 04e8874 + 4e8fa96 commit 85f3c0a

File tree

16 files changed

+138
-117
lines changed

16 files changed

+138
-117
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Setup Nix
2+
3+
description: GC Disk, install nix
4+
5+
inputs:
6+
preFetchNix:
7+
description: Pre-run nix-shell for downloading the dependencies
8+
required: false
9+
default: ""
10+
gc:
11+
description: Clear up storage from worker
12+
required: false
13+
default: false
14+
enable_kvm:
15+
required: false
16+
default: true
17+
18+
runs:
19+
using: composite
20+
steps:
21+
- name: Disk Garbage Collection
22+
shell: bash
23+
if: ${{ runner.os == 'Linux' && inputs.gc }}
24+
run: |
25+
lsblk -fm
26+
sudo rm -rf /usr/local/lib/android
27+
sudo rm -rf /usr/local/.ghcup
28+
sudo rm -rf /opt/hostedtoolcache
29+
sudo rm -rf /usr/share/dotnet
30+
sudo rm -rf /usr/share/swift
31+
lsblk -fm
32+
- id: nixpkgs
33+
shell: bash
34+
run: |
35+
echo "nix_path=nixpkgs=$(jq -r '.nixpkgs.url' nix/sources.json)" >> $GITHUB_OUTPUT
36+
echo "home=${HOME:-/home/runner}" >> $GITHUB_OUTPUT
37+
- uses: cachix/[email protected]
38+
with:
39+
nix_path: "${{ steps.nixpkgs.outputs.nix_path }}"
40+
install_options: ${{ runner.os == 'Linux' && '--no-daemon' || '' }}
41+
enable_kvm: ${{ inputs.enable_kvm }}
42+
extra_nix_config: |
43+
keep-env-derivations = true
44+
keep-outputs = true
45+
env:
46+
HOME: ${{ steps.nixpkgs.outputs.home }}
47+
NIX_PATH: "${{ steps.nixpkgs.outputs.nix_path }}"
48+
- name: PreFetch Nix
49+
if: ${{ inputs.preFetchNix }}
50+
shell: bash
51+
run: |
52+
IFS=',' read -ra arr <<< "${{ inputs.preFetchNix }}"
53+
for nix in "${arr[@]}"; do
54+
echo "::group::Step: nix-build $nix"
55+
start=$(date +%s)
56+
57+
nix-build "$nix"
58+
59+
end=$(date +%s)
60+
echo "::endgroup::"
61+
62+
echo "⏱️ $nix took $(( end - start ))s"
63+
done

.github/workflows/develop-chart.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: cachix/[email protected]
15-
16-
- name: Pre-populate nix-shell
17-
run: |
18-
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
19-
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
20-
nix-shell --pure --run "echo" ./scripts/helm/shell.nix
14+
- uses: ./.github/actions/setup-nix
15+
with:
16+
preFetchNix: ./scripts/helm/shell.nix
2117

2218
- name: Publish locally in the workspace
2319
run: |

.github/workflows/develop-to-release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11-
- uses: cachix/[email protected]
12-
- name: Pre-populate nix-shell
13-
run: |
14-
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
15-
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
16-
nix-shell --pure --run "echo" ./scripts/helm/shell.nix
11+
- uses: ./.github/actions/setup-nix
12+
with:
13+
preFetchNix: ./scripts/helm/shell.nix
1714
- name: Check if the chart is publishable
1815
run: |
1916
branch="${{ github.ref_name }}"

.github/workflows/helm-chart.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ jobs:
1616
- uses: actions/checkout@v4
1717
with:
1818
submodules: 'recursive'
19-
- uses: cachix/[email protected]
20-
- name: Pre-populate nix-shell
21-
run: |
22-
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
23-
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
24-
nix-shell --run "echo" ./scripts/helm/shell.nix
19+
- uses: ./.github/actions/setup-nix
20+
with:
21+
preFetchNix: ./scripts/helm/shell.nix
2522
- name: HelmChart publish test
2623
run: nix-shell --pure --run "./scripts/helm/test-publish-chart-yaml.sh" ./scripts/helm/shell.nix
2724
- name: HelmChart Readme
@@ -35,17 +32,9 @@ jobs:
3532
- uses: actions/checkout@v4
3633
with:
3734
submodules: recursive
38-
- uses: cachix/install-nix[email protected]
35+
- uses: ./.github/actions/setup-nix
3936
with:
40-
enable_kvm: true
41-
- name: Setup Nix Path
42-
run: |
43-
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
44-
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
45-
- name: Pre-populate K8s nix-shell
46-
run: nix-shell ./scripts/k8s/shell.nix --run "echo"
47-
- name: Pre-populate helm nix-shell
48-
run: nix-shell ./scripts/helm/shell.nix --run "echo"
37+
preFetchNix: ./scripts/k8s/shell.nix,./scripts/helm/shell.nix
4938
- name: Generate image list
5039
run: nix-shell ./scripts/helm/shell.nix --run "./scripts/helm/images.sh generate --dependency-update --exit-code"
5140
- name: Login to Docker Hub

.github/workflows/helm-testing-chart.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ jobs:
1515
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
18-
- uses: cachix/[email protected]
19-
- name: Pre-populate nix-shell
20-
run: |
21-
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
22-
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
23-
nix-shell --pure --run "echo" ./scripts/helm/shell.nix
18+
- uses: ./.github/actions/setup-nix
19+
with:
20+
preFetchNix: ./scripts/helm/shell.nix
2421
- name: Update chart
2522
run: |
2623
# Update logLevel to 'debug'

.github/workflows/image-pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
- uses: actions/checkout@v4
1515
with:
1616
submodules: 'recursive'
17-
- uses: cachix/[email protected]
17+
- uses: ./.github/actions/setup-nix
18+
with:
19+
gc: true
1820
- name: Test building the release images
1921
run: ./scripts/release.sh --skip-publish --build-bins --debug
2022
- name: Test building the static binaries

.github/workflows/image.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ jobs:
4040
git fetch -f origin ${{ github.ref }}:${{ github.ref }}
4141
fi
4242
43-
- uses: cachix/[email protected]
44-
43+
- uses: ./.github/actions/setup-nix
4544
- name: Login to Docker Hub
4645
uses: docker/login-action@v3
4746
with:
@@ -62,4 +61,4 @@ jobs:
6261
./scripts/release.sh --tag ${{ inputs.tag }} --registry ${{ inputs.registry }}/${{ github.repository_owner }}/${{ inputs.namespace }}
6362
elif [[ "${{ github.event_name }}" == "push" ]]; then
6463
./scripts/release.sh
65-
fi
64+
fi

.github/workflows/k8s-ci.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,9 @@ jobs:
2323
with:
2424
fetch-depth: 0
2525
submodules: recursive
26-
- uses: cachix/install-nix[email protected]
26+
- uses: ./.github/actions/setup-nix
2727
with:
28-
enable_kvm: true
29-
- name: Setup Nix Path
30-
run: |
31-
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
32-
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
33-
- name: Pre-populate K8s nix-shell
34-
run: nix-shell ./scripts/k8s/shell.nix --run "echo"
35-
- name: Pre-populate helm nix-shell
36-
run: nix-shell ./scripts/helm/shell.nix --run "echo"
37-
- name: Pre-populate pytest nix-shell
38-
run: nix-shell ./scripts/python/shell.nix --run "echo"
28+
preFetchNix: ./scripts/k8s/shell.nix,./scripts/helm/shell.nix,./scripts/python/shell.nix
3929
- name: Login to Docker Hub
4030
if: ${{ !inputs.helm-pins }}
4131
uses: docker/login-action@v3

.github/workflows/lint.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ jobs:
1515
with:
1616
submodules: 'recursive'
1717
fetch-depth: 0
18-
- uses: cachix/[email protected]
19-
- name: Pre-populate nix-shell
20-
run: |
21-
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
22-
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
23-
nix-shell --run "echo" shell.nix
18+
- uses: ./.github/actions/setup-nix
19+
with:
20+
preFetchNix: ./shell.nix
2421
- name: Handle Rust dependencies caching
2522
uses: Swatinem/rust-cache@v2
2623
- name: Lint rust code

.github/workflows/mod-update.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818
submodules: recursive
19-
- uses: cachix/[email protected]
20-
- name: Pre-populate nix-shell
21-
run: |
22-
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
23-
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
19+
- uses: ./.github/actions/setup-nix
2420
- name: Update submodules
2521
run: |
2622
./scripts/git/set-submodule-branches.sh -u

0 commit comments

Comments
 (0)