Skip to content

ci(release): trigger GitLab wheel publish workflows #22

ci(release): trigger GitLab wheel publish workflows

ci(release): trigger GitLab wheel publish workflows #22

Workflow file for this run

name: Branch Checks
on:
pull_request:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCCACHE_MEMCACHED_ENDPOINT: ${{ vars.SCCACHE_MEMCACHED_ENDPOINT }}
permissions:
contents: read
packages: read
jobs:
license-headers:
name: License Headers
runs-on: build-amd64
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install tools
run: mise install
- name: Check license headers
run: mise run license:check
rust:
name: Rust (${{ matrix.runner }})
strategy:
fail-fast: false
matrix:
runner: [build-amd64, build-arm64]
runs-on: ${{ matrix.runner }}
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install tools
run: mise install
- name: Cache Rust target and registry
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
with:
# Separate caches for clippy (check-like) vs test (full build)
# so they don't thrash each other's artifacts
shared-key: rust-checks-${{ matrix.runner }}
# Cache the sccache directory too
cache-directories: .cache/sccache
- name: Format
run: mise run rust:format:check
- name: Lint
run: mise run rust:lint
- name: Test
run: mise run test:rust
- name: sccache stats
if: always()
run: mise x -- sccache --show-stats
python:
name: Python (${{ matrix.runner }})
strategy:
fail-fast: false
matrix:
runner: [build-amd64, build-arm64]
runs-on: ${{ matrix.runner }}
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install tools
run: mise install
- name: Install dependencies
run: uv sync --frozen
- name: Lint
run: mise run python:lint
- name: Test
run: mise run test:python
internal-wheel-publish-smoke:
name: Internal Wheel Publish Smoke
if: ${{ github.event.pull_request.head.repo.fork == false }}
runs-on: [self-hosted, nv]
timeout-minutes: 10
steps:
- name: Trigger GitLab CI
env:
GITLAB_CI_TRIGGER_TOKEN: ${{ secrets.GITLAB_CI_TRIGGER_TOKEN }}
GITLAB_CI_TRIGGER_URL: ${{ secrets.GITLAB_CI_TRIGGER_URL }}
WHEEL_FILENAMES: openshell-branch-check-py3-none-any.whl,openshell-branch-check-manylinux_x86_64.whl
run: |
set -euo pipefail
response=$(curl -X POST \
--fail \
--silent \
--show-error \
-F "token=${GITLAB_CI_TRIGGER_TOKEN}" \
-F "ref=feat/ci-trigger-pipeline" \
-F "variables[PIPELINE_ACTION]=publish_wheels" \
-F "variables[GITHUB_REPOSITORY]=${GITHUB_REPOSITORY}" \
-F "variables[RELEASE_TAG]=devel" \
-F "variables[RELEASE_VERSION]=branch-check-pr-${{ github.event.pull_request.number }}" \
-F "variables[RELEASE_KIND]=dev" \
-F "variables[WHEEL_FILENAMES]=${WHEEL_FILENAMES}" \
"${GITLAB_CI_TRIGGER_URL}")
pipeline_id=$(printf '%s' "$response" | sed -n 's/.*"id":\([0-9][0-9]*\).*/\1/p')
pipeline_status=$(printf '%s' "$response" | sed -n 's/.*"status":"\([^"]*\)".*/\1/p')
echo "Triggered GitLab pipeline ${pipeline_id:-unknown} with status=${pipeline_status:-unknown}"