Add Alibaba Cloud to adopters (#2097) #1064
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: Pre-commit checks | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
build-api-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: The API documentation hasn't changed | |
run: | | |
make build-api-docs | |
if ! git diff --quiet -- docs/api-docs.md; then | |
echo "Need to re-run 'make build-api-docs' and commit the changes" | |
git diff -- docs/api-docs.md; | |
false | |
fi | |
build-sparkctl: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: build sparkctl | |
run: | | |
make build-sparkctl | |
build-spark-operator: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: Run go fmt check | |
run: make go-fmt | |
- name: Run go vet | |
run: make go-vet | |
- name: Run unit tests | |
run: make unit-test | |
- name: Build Spark-Operator Docker Image | |
run: make docker-build IMAGE_TAG=latest | |
- name: Check changes in resources used in docker file | |
run: | | |
DOCKERFILE_RESOURCES=$(cat Dockerfile | grep -P -o "COPY [a-zA-Z0-9].*? " | cut -c6-) | |
for resource in $DOCKERFILE_RESOURCES; do | |
# If the resource is different | |
if ! git diff --quiet origin/master -- $resource; then | |
## And the appVersion hasn't been updated | |
if ! git diff origin/master -- charts/spark-operator-chart/Chart.yaml | grep +appVersion; then | |
echo "resource used in docker.io/kubeflow/spark-operator has changed in $resource, need to update the appVersion in charts/spark-operator-chart/Chart.yaml" | |
git diff origin/master -- $resource; | |
echo "failing the build... " && false | |
fi | |
fi | |
done | |
build-helm-chart: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.14.3 | |
- name: Produce the helm documentation | |
run: | | |
make helm-docs | |
if ! git diff --quiet -- charts/spark-operator-chart/README.md; then | |
echo "Need to re-run 'make helm-docs' and commit the changes" | |
false | |
fi | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@v2.6.1 | |
- name: Print chart-testing version information | |
run: ct version | |
- name: Run chart-testing (lint) | |
run: ct lint | |
- name: Run chart-testing (list-changed) | |
id: list-changed | |
run: | | |
changed=$(ct list-changed) | |
if [[ -n "$changed" ]]; then | |
echo "::set-output name=changed::true" | |
fi | |
- name: Detect CRDs drift between chart and manifest | |
run: make detect-crds-drift | |
- name: setup minikube | |
uses: manusa/actions-setup-minikube@v2.11.0 | |
with: | |
minikube version: v1.33.0 | |
kubernetes version: v1.30.0 | |
start args: --memory 6g --cpus=2 --addons ingress | |
github token: ${{ inputs.github-token }} | |
- name: Run chart-testing (install) | |
run: | | |
docker build -t docker.io/kubeflow/spark-operator:local . | |
minikube image load docker.io/kubeflow/spark-operator:local | |
ct install | |
integration-test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
- name: setup minikube | |
uses: manusa/actions-setup-minikube@v2.11.0 | |
with: | |
minikube version: v1.33.0 | |
kubernetes version: v1.30.0 | |
start args: --memory 6g --cpus=2 --addons ingress | |
github token: ${{ inputs.github-token }} | |
- name: Build local spark-operator docker image for minikube testing | |
run: | | |
docker build -t docker.io/kubeflow/spark-operator:local . | |
minikube image load docker.io/kubeflow/spark-operator:local | |
# The integration tests are currently broken see: https://github.com/kubeflow/spark-operator/issues/1416 | |
# - name: Run chart-testing (integration test) | |
# run: make integration-test | |
- name: Setup tmate session | |
if: failure() | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 15 |