diff --git a/.github/workflows/ca-test.yaml b/.github/workflows/ca-test.yaml new file mode 100644 index 000000000000..a96e3105600c --- /dev/null +++ b/.github/workflows/ca-test.yaml @@ -0,0 +1,42 @@ +name: Cluster Autoscaler + +on: + push: + paths: + - 'cluster-autoscaler/**' + pull_request: + paths: + - 'cluster-autoscaler/**' + +env: + GOPATH: ${{ github.workspace }}/go + +permissions: + contents: read + checks: write + +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + with: + path: ${{ env.GOPATH }}/src/k8s.io/autoscaler + + - name: Set up Go + uses: actions/setup-go@v5.5.0 + with: + go-version: '1.24.0' + cache-dependency-path: | + ${{ env.GOPATH}}/src/k8s.io/autoscaler/cluster-autoscaler/go.sum + + - name: Apt-get + run: sudo apt-get install libseccomp-dev -qq + + - name: Test + working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler + run: hack/for-go-proj.sh cluster-autoscaler + env: + GO111MODULE: auto + PROJECT_NAMES: "" \ No newline at end of file diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml deleted file mode 100644 index 2c256d16f691..000000000000 --- a/.github/workflows/pr.yaml +++ /dev/null @@ -1,67 +0,0 @@ -permissions: - contents: read - -jobs: - changes: - permissions: - contents: read # for dorny/paths-filter to fetch a list of changed files - pull-requests: read # for dorny/paths-filter to read pull requests - outputs: - charts: ${{ steps.filter.outputs.charts }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - id: filter - uses: dorny/paths-filter@v2.11.1 - with: - filters: | - charts: - - 'charts/**/Chart.yaml' - - 'charts/**/*' - token: ${{ secrets.GITHUB_TOKEN }} - helm-lint-test: - if: ${{ needs.changes.outputs.charts == 'true' }} - name: Helm chart - needs: - - changes - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - name: Fetch history - run: git fetch --prune --unshallow - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.6.1 - - name: Run chart-testing (lint) - run: ct lint - # Only build a kind cluster if there are chart changes to test. - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed) - if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT - fi - - if: steps.list-changed.outputs.changed == 'true' - name: Create kind cluster - uses: helm/kind-action@v1.12.0 - - if: steps.list-changed.outputs.changed == 'true' - name: Run chart-testing (install) - run: ct install - helm-docs-validate: - if: ${{ needs.changes.outputs.charts == 'true' }} - name: Helm Docs - needs: - - changes - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - name: Run helm-docs - uses: docker://jnorwood/helm-docs:v1.3.0 - - name: Check for changes - run: git diff --quiet charts/*/README.md - -name: Lint and Test Charts -on: pull_request diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index ce8b3102a068..000000000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,34 +0,0 @@ -permissions: - contents: read - -jobs: - release: - permissions: - contents: write # for helm/chart-releaser-action to push chart release and create a release - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - - name: Install Helm - uses: azure/setup-helm@v4.2.0 - with: - version: v3.4.0 - - - env: - CR_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CR_RELEASE_NAME_TEMPLATE: "cluster-autoscaler-chart-{{ .Version }}" - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.6.0 -name: Release Charts -on: - push: - branches: - - master diff --git a/.github/workflows/ci.yaml b/.github/workflows/verify.yaml similarity index 69% rename from .github/workflows/ci.yaml rename to .github/workflows/verify.yaml index fb3c9b0bd707..238f49cacaf6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/verify.yaml @@ -1,4 +1,4 @@ -name: Tests +name: Verify Go on: - push @@ -12,7 +12,8 @@ permissions: checks: write jobs: - test-and-verify: + verify: + name: verify runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.2.2 @@ -41,16 +42,4 @@ jobs: working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler run: hack/verify-all.sh -v env: - GO111MODULE: auto - - - name: golangci-lint - vertical-pod-autoscaler - uses: golangci/golangci-lint-action@v8 - with: - args: --timeout=30m - working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler/vertical-pod-autoscaler - - - name: Test - working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler - run: hack/for-go-proj.sh test - env: - GO111MODULE: auto + GO111MODULE: auto \ No newline at end of file