Skip to content

Update license annotations, and some missed files (#1912) #1

Update license annotations, and some missed files (#1912)

Update license annotations, and some missed files (#1912) #1

Workflow file for this run

---
name: Lint
concurrency:
group: ci-lint-on-${{ github.event_name }}-from-${{ github.ref_name }}
cancel-in-progress: true
on:
push:
branches:
- "pull-request/[0-9]+"
- "*branch-*"
- "main"
merge_group:
defaults:
run:
shell: bash -el {0}
jobs:
pre-commit:
runs-on: 'linux-amd64-cpu4'
strategy:
fail-fast: false
matrix:
version: ['3.10', '3.11', '3.12']
if: ${{ github.repository_owner == 'nv-legate' }}
permissions:
contents: read # This is required for actions/checkout
name: "pre-commit python-${{ matrix.version }}"
steps:
- name: Checkout ${{ github.event.repository.name }} (= this repo)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate requirements.txt
run: |
{
echo "shellcheck-py"
echo "cmakelang"
echo "rich"
} > requirements.txt
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
cache: 'pip'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Set LEGATE_DIR
run: |
echo "LEGATE_DIR=${{ github.workspace }}" >> "${GITHUB_ENV}"
- name: run pre-commit
uses: pre-commit/[email protected]
test-configure:
env:
LEGATE_ARCH: arch-ci-test-lint
runs-on: 'linux-amd64-cpu4'
strategy:
fail-fast: false
matrix:
version: ['3.10', '3.11', '3.12']
generator: [ninja, make]
if: ${{ github.repository_owner == 'nv-legate' }}
permissions:
contents: read # This is required for actions/checkout
name: "test-configure, Python ${{ matrix.version }}, Generator ${{ matrix.generator }}"
steps:
- name: Checkout ${{ github.event.repository.name }} (= this repo)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Miniforge3
miniforge-version: latest
activate-environment: legate
use-mamba: true
- name: Get Week Number
id: get-week-hash
run: |
WEEK="$(/bin/date -u '+%Y%W')"
echo "week=${WEEK}" >> "${GITHUB_OUTPUT}"
- name: Cache Conda env
uses: actions/cache@v4
with:
path: ${{ env.CONDA }}/envs
key:
ci-gh-lint-test-configure--"${{ matrix.generator }}"--${{
runner.os }}--${{ runner.arch }}--${{ matrix.version }}--${{
steps.get-week-hash.outputs.week }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 7
id: cache
- name: Update environment
run: |
mamba create -n legate rich cmake clangxx compiler-rt pytest pytest-mock "${{ matrix.generator }}"
if: steps.cache.outputs.cache-hit != 'true'
- name: List Conda packages and info
run: |
conda info
conda list
- name: Run tests
run: |
pytest ./config/aedifix/tests
tidy:
env:
LEGATE_ARCH: arch-ci-lint
runs-on: 'linux-amd64-cpu16'
strategy:
fail-fast: true
if: ${{ github.repository_owner == 'nv-legate' }}
permissions:
contents: read # This is required for actions/checkout
steps:
- name: List machine info
run: |
uname -a
lsb_release -a
- name: Checkout ${{ github.event.repository.name }} (= this repo)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Miniforge3
miniforge-version: latest
activate-environment: legate
use-mamba: true
- name: Get Week Number
id: get-week-hash
run: |
WEEK="$(/bin/date -u '+%Y%W')"
echo "week=${WEEK}" >> "${GITHUB_OUTPUT}"
- name: Cache Conda env
uses: actions/cache@v4
with:
path: ${{ env.CONDA }}/envs
key:
ci-gh-lint-tidy-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-week-hash.outputs.week }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 9
id: cache
- name: Update environment
run: |
mamba create -n legate cmake clang clangxx clang-tools elfutils hdf5 rich ninja
if: steps.cache.outputs.cache-hit != 'true'
- name: List Conda packages and info
run: |
conda info
conda list
- name: List clang-tidy version
run: |
clang-tidy --version
- name: Configure legate
# CMake Error: CMake was unable to find a build program corresponding to "Ninja".
# CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build
# tool.
run: |
./configure \
--with-tests \
--with-benchmarks \
--with-cc=clang \
--with-cxx=clang++ || { cat configure.log; exit 1; }
echo "LEGATE_DIR=${{ github.workspace }}" >> "${GITHUB_ENV}"
- name: Run clang-tidy
run: |
# "-- -k" tells the underlying build tool to not stop on first error. We want
# CI to unearth all clang-tidy errors in one go, otherwise the dev needs to play
# whack-a-mole with each additional error.
LEGATE_CMAKE_ARGS="-- -k 0" make tidy -j 14
lint-pass:
if: always()
needs:
- pre-commit
- test-configure
- tidy
runs-on: linux-amd64-cpu4
steps:
- name: Check job results
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1