Skip to content

Remove incorrect Role Action #314

Remove incorrect Role Action

Remove incorrect Role Action #314

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: PR Checks
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
#######################
# Path Filters #
#######################
check-paths:
runs-on: ubuntu-latest
outputs:
ci: ${{ steps.filter.outputs.ci }}
docs: ${{ steps.filter.outputs.docs }}
ui: ${{ steps.filter.outputs.ui }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for accurate diffing
- name: Check which paths changed
uses: dorny/paths-filter@v3
id: filter
with:
# Use empty token to force git-based detection
token: ''
filters: |
ci:
- '.github/workflows/pr-checks.yaml'
- 'BUILD'
- 'MODULE.bazel'
- 'bzl/**'
- 'src/**'
- 'run/**'
docs:
- '.github/workflows/pr-checks.yaml'
- 'docs/**'
- 'workflows/**'
ui:
- '.github/workflows/pr-checks.yaml'
- 'BUILD'
- 'MODULE.bazel'
- 'bzl/**'
- 'ui/**'
#######################
# CI Tests #
#######################
ci-public:
needs: [check-paths]
if: |
(needs.check-paths.outputs.ci == 'true') &&
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true) &&
(github.event.action != 'closed')
runs-on: ubuntu-latest
steps:
- name: Free disk space
run: |
echo "Disk space before cleanup:"
df -h
echo "Freeing disk space..."
echo "Removing .NET..."
sudo rm -rf /usr/share/dotnet || true
echo "Removing Android..."
sudo rm -rf /usr/local/lib/android || true
echo "Removing GHC..."
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/.ghcup || true
echo "Removing CodeQL..."
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
echo "Pruning Docker images..."
sudo docker image prune --all --force || true
echo "Disk space after cleanup:"
df -h
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@4fd964a13a440a8aeb0be47350db2fc640f19ca8
with:
bazelisk-cache: true
bazelisk-version: 1.27.0
disk-cache: ${{ github.workflow }}
repository-cache: true
external-cache: |
manifest:
# Python dependencies
osmo_python_deps: src/locked_requirements.txt
osmo_tests_python_deps: src/tests/locked_requirements.txt
osmo_mypy_deps: bzl/mypy/locked_requirements.txt
pylint_python_deps: bzl/linting/locked_requirements.txt
# Go dependencies
io_bazel_rules_go: src/runtime/go.mod
bazel_gazelle: src/runtime/go.sum
- name: Run Tests
run: |
bazel test --test_output=errors -- //... -//ui/...
ci-internal:
needs: [check-paths]
if: |
(github.event_name == 'workflow_dispatch') ||
(
needs.check-paths.outputs.ci == 'true' &&
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.fork == false &&
github.event.action != 'closed'
)
runs-on: self-hosted
environment:
name: internal-ci
container:
image: python:3.10-bullseye
env:
DOCKER_HOST: "tcp://docker:2375"
DOCKER_TLS_CERTDIR: ""
services:
docker:
image: docker:dind
env:
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
options: --privileged
ports:
- 2375:2375
steps:
- name: Install dependencies
run: |
apt-get update
apt-get install -y git-lfs
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@4fd964a13a440a8aeb0be47350db2fc640f19ca8
with:
bazelisk-cache: true
bazelisk-version: 1.27.0
- name: Run Tests
run: |
bazel test --remote_cache=${{ secrets.BAZEL_REMOTE_CACHE_URL }} \
--test_env=DOCKER_HOST=tcp://docker:2375 \
--test_env=TESTCONTAINERS_HOST_OVERRIDE=docker \
--test_output=errors \
-- \
//... \
-//ui/...
#######################
# Docs Build #
#######################
docs-build:
needs: [check-paths]
if: needs.check-paths.outputs.docs == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Setup Python
if: github.event.action != 'closed'
uses: actions/setup-python@v4
with:
python-version: '3.10.18'
- name: Install dependencies
if: github.event.action != 'closed'
run: |
pip install -U -r docs/locked_requirements.txt
pip install -U -r src/locked_requirements.txt
- name: Build Sphinx documentation
if: github.event.action != 'closed'
run: |
make -C docs build ERR_DIR=build_error_logs OUT_DIR=public
if [ -d "docs/build_error_logs" ] && [ "$(find docs/build_error_logs -name '*.log' -size +0c)" ]; then
echo "Build errors found:"
find docs/build_error_logs -name '*.log' -size +0c -exec echo "Error in {}: " \; -exec cat {} \;
exit 1
fi
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./docs/public/
preview-branch: gh-pages/documentation
- name: Run spelling check
id: spelling
if: github.event.action != 'closed'
continue-on-error: true
run: |
make -C docs spelling ERR_DIR=spelling_error_logs OUT_DIR=public
if [ -d "docs/spelling_error_logs" ] && [ "$(find docs/spelling_error_logs -name '*.log' -size +0c)" ]; then
echo "Spelling errors found:"
find docs/spelling_error_logs -name '*.log' -size +0c -exec echo "Error in {}: " \; -exec cat {} \;
exit 1
fi
- name: Restore lychee cache
if: github.event.action != 'closed'
uses: actions/cache/restore@v4
with:
path: .lycheecache
key: cache-lychee-pr-${{ github.event.pull_request.number }}
restore-keys: cache-lychee-
- name: Link Checker
id: link-checker
if: github.event.action != 'closed'
uses: lycheeverse/lychee-action@v2
with:
args: --config docs/lychee.toml --no-progress '**/*.html' docs/public
output: docs/link_check_error_logs/lychee-report.md
- name: Save lychee cache
uses: actions/cache/save@v4
if: github.event.action != 'closed' && steps.link-checker.outcome == 'success'
with:
path: .lycheecache
key: cache-lychee-pr-${{ github.event.pull_request.number }}
- name: Check spelling and link results
if: github.event.action != 'closed'
run: |
if [ "${{ steps.spelling.outcome }}" == "failure" ] || [ "${{ steps.link-checker.outcome }}" == "failure" ]; then
echo "::error::One or more checks failed:"
[ "${{ steps.spelling.outcome }}" == "failure" ] && echo " - Spelling check failed"
[ "${{ steps.link-checker.outcome }}" == "failure" ] && echo " - Link check failed"
exit 1
fi
echo "All checks passed"
- name: Upload build artifacts
if: always() && github.event.action != 'closed'
uses: actions/upload-artifact@v4
with:
name: documentation-build
path: |
docs/public/
docs/build_error_logs/
docs/spelling_error_logs/
docs/link_check_error_logs/
retention-days: 3
#######################
# UI Build #
#######################
ui-build:
needs: [check-paths]
if: |
(needs.check-paths.outputs.ui == 'true' && github.event.action != 'closed') ||
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@4fd964a13a440a8aeb0be47350db2fc640f19ca8
with:
bazelisk-cache: true
bazelisk-version: 1.27.0
disk-cache: ${{ github.workflow }}
repository-cache: true
external-cache: |
manifest:
npm: ui/pnpm-lock.yaml
- name: Build UI
run: |
bazel build //ui/...