Update ci.yml #46
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: H2O-3 CI Nightly | |
| on: | |
| push: | |
| branches: | |
| - devops/rohan/mig-h2o-3-nightly-pipeline-to-gha | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| checkout-and-build: | |
| runs-on: ubuntu-latest | |
| env: | |
| MODE: MODE_NIGHTLY | |
| outputs: | |
| build-success: ${{ steps.set-status.outputs.result }} | |
| mode: ${{ env.MODE }} | |
| steps: | |
| - name: Checkout H2O-3 | |
| uses: actions/checkout@v4 | |
| - name: Recreate symlink for h2o-py-cloud-extensions | |
| run: ln -s ../h2o-py/h2o h2o-py-cloud-extensions/h2o | |
| - name: Make scripts executable | |
| run: chmod +x ./scripts/github/*.sh | |
| - name: Install required Python modules | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| pip install 'tabulate>=0.7.5' 'requests>=2.10' | |
| - name: Install R and dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| r-base \ | |
| texlive-latex-base \ | |
| texlive-fonts-recommended \ | |
| texlive-fonts-extra \ | |
| texlive-latex-extra \ | |
| ghostscript \ | |
| pandoc | |
| mkdir -p "$HOME/R/library" | |
| echo 'R_LIBS_USER=~/R/library' >> ~/.Renviron | |
| echo "R_LIBS_USER=$HOME/R/library" >> $GITHUB_ENV | |
| echo "HOME=$HOME" >> $GITHUB_ENV | |
| Rscript -e 'install.packages(c("roxygen2", "devtools", "pkgdown"), repos="https://cloud.r-project.org", lib="~/R/library")' | |
| - name: Verify R and LaTeX Setup | |
| run: | | |
| Rscript -e 'sessionInfo()' | |
| pdflatex --version | |
| Rscript -e 'roxygen2::roxygenise("h2o-r", roclets=c("rd"))' || true | |
| - name: Retry Health Check & Build | |
| id: set-status | |
| run: | | |
| echo "::group::Health check and build" | |
| retries=5 | |
| count=0 | |
| while [ $count -lt $retries ]; do | |
| echo "Attempt #$((count+1))" | |
| if ./scripts/github/init_pipeline.sh "$MODE"; then | |
| if ./scripts/github/health_check.sh; then | |
| echo "result=success" >> $GITHUB_OUTPUT | |
| exit 0 | |
| fi | |
| fi | |
| count=$((count+1)) | |
| sleep 10 | |
| done | |
| echo "result=failure" >> $GITHUB_OUTPUT | |
| exit 1 | |
| - name: Configure AWS Credentials for H2O Shared Service Prod | |
| if: steps.set-status.outputs.result == 'success' | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| audience: "sts.amazonaws.com" | |
| aws-region: "us-east-1" | |
| role-session-name: "h2o-shared-service-prod" | |
| role-to-assume: "arn:aws:iam::851725263148:role/GitHub-OIDC-Role" | |
| - name: Download smalldata from S3 | |
| if: steps.set-status.outputs.result == 'success' | |
| run: | | |
| mkdir -p smalldata | |
| aws s3 sync s3://h2o-public-test-data/smalldata/ ./smalldata/ | |
| - name: Sync required test data | |
| if: steps.set-status.outputs.result == 'success' | |
| run: ./gradlew syncSmalldata --no-daemon --info | |
| - name: Run Gradle Build | |
| if: steps.set-status.outputs.result == 'success' | |
| run: ./gradlew --parallel clean build -x test -x :h2o-r:buildPackageDocumentation -x :h2o-r:buildPKG -x :h2o-r:buildPKGClient -x :h2o-r:untar --warning-mode all | |
| run-tests: | |
| needs: checkout-and-build | |
| if: needs.checkout-and-build.outputs.build-success == 'success' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| java: [8, 11, 17] | |
| python: [3.6, 3.7, 3.11] | |
| steps: | |
| - name: Checkout H2O-3 | |
| uses: actions/checkout@v4 | |
| - name: Configure AWS Credentials for H2O Shared Service Prod | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| audience: "sts.amazonaws.com" | |
| aws-region: "us-east-1" | |
| role-session-name: "h2o-shared-service-prod" | |
| role-to-assume: "arn:aws:iam::851725263148:role/GitHub-OIDC-Role" | |
| - name: Download smalldata from S3 | |
| run: | | |
| mkdir -p smalldata | |
| aws s3 sync s3://h2o-public-test-data/smalldata/ ./smalldata/ | |
| - name: Sync required test data | |
| run: ./gradlew syncSmalldata --no-daemon --info | |
| - name: Recreate symlink for h2o-py-cloud-extensions | |
| run: ln -s ../h2o-py/h2o h2o-py-cloud-extensions/h2o | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Set up Java ${{ matrix.java }} | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: ${{ matrix.java }} | |
| - name: Install required Python modules | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| pip install 'tabulate>=0.7.5' 'requests>=2.10' 'wheel' | |
| - name: Make test scripts executable | |
| run: chmod +x ./scripts/github/*.sh | |
| - name: Run Nightly Tests | |
| run: ./scripts/github/define_test_stages.sh ${{ needs.checkout-and-build.outputs.mode }} ${{ matrix.python }} ${{ matrix.java }} |