Merge pull request #223 from pawelpaszki/disconnected-workflow-fix #1
This file contains hidden or 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: E2E Tests | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: | |
| - '**' | |
| push: | |
| branches: | |
| - dev | |
| - 'release-*' | |
| concurrency: | |
| group: ${{ github.head_ref }}-${{ github.workflow }} | |
| cancel-in-progress: true | |
| env: | |
| OPERATOR_IMG: quay.io/opendatahub/kuberay-operator:dev | |
| KUBERAY_TEST_TIMEOUT_SHORT: 5m | |
| KUBERAY_TEST_TIMEOUT_MEDIUM: 12m | |
| KUBERAY_TEST_TIMEOUT_LONG: 15m | |
| KUBERAY_TEST_RAY_IMAGE: rayproject/ray:2.52.1 | |
| jobs: | |
| build-operator: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Set up Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: v1.25 | |
| - name: Build operator image | |
| run: | | |
| cd ray-operator | |
| make docker-build IMG="${OPERATOR_IMG}" ENGINE=docker | |
| docker save -o /tmp/operator.tar "${OPERATOR_IMG}" | |
| - name: Upload operator image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: operator-image | |
| retention-days: 1 | |
| path: /tmp/operator.tar | |
| e2e-rayjob: | |
| needs: build-operator | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.draft == false) }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test: | |
| - TestRayJob | |
| - TestRayJobSuspend | |
| - TestRayJobLightWeightMode | |
| - TestRayJobWithClusterSelector | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Set up Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: v1.25 | |
| - name: Set up gotestfmt | |
| uses: gotesttools/gotestfmt-action@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download operator image | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: operator-image | |
| - name: Load operator image | |
| run: docker load -i operator.tar | |
| - name: Setup and start KinD cluster | |
| uses: ./.github/workflows/actions/kind | |
| - name: Run RayJob e2e test | |
| env: | |
| IMG: ${{ env.OPERATOR_IMG }} | |
| SKIP_BUILD: "1" | |
| run: | | |
| chmod +x ./scripts/run-e2e-rayjob-kind.sh | |
| ./scripts/run-e2e-rayjob-kind.sh --json --test "${{ matrix.test }}" | |
| - name: Print KubeRay operator logs | |
| if: always() | |
| run: | | |
| echo "Printing KubeRay operator logs" | |
| kubectl logs -n default --tail=-1 -l app.kubernetes.io/name=kuberay-operator | tee "./kuberay-operator-${{ matrix.test }}.log" | |
| - name: Upload logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: logs-${{ matrix.test }} | |
| retention-days: 10 | |
| path: | | |
| **/*.log |