forked from facebookresearch/fairseq2
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (62 loc) · 2.03 KB
/
_lint_cc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
on:
workflow_call:
inputs:
torch:
type: string
default: '2.1.2'
py:
type: string
default: '3.11'
jobs:
lint:
name: Lint
runs-on:
labels: 4-core-ubuntu
container:
image: ghcr.io/facebookresearch/fairseq2-ci-manylinux_x86_64:2-cu118
defaults:
run:
shell: bash
steps:
- name: Check-out the repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Create the Python virtual environment
run: |
python${{ inputs.py }} -m venv ~/venv
echo ~/venv/bin >> "$GITHUB_PATH"
- name: Install PyTorch
run: |
pip install --extra-index-url https://download.pytorch.org/whl/cu118\
torch==${{ inputs.torch }}\
- name: Install requirements
run: |
pip install --requirement native/python/requirements-build.txt
- name: Build the compilation database
id: setup
working-directory: native
run: |
# Since we are only building the compilation database, we can ignore
# CUDA compatibility.
export CUDAFLAGS="--allow-unsupported-compiler"
# TODO: set FAIRSEQ2N_USE_CUDA once lint issues are fixed.
CC=clang CXX=clang++ cmake\
-GNinja -DFAIRSEQ2N_PYTHON_DEVEL=OFF -B build
cmake --build build
- name: Run clang-tidy
if: success() || (failure() && steps.setup.outcome == 'success')
working-directory: native
run: |
echo "::add-matcher::./ci/problem-matchers/gcc.json"
function remove_matcher
{
echo "::remove-matcher owner=gcc::"
}
trap remove_matcher EXIT
run-clang-tidy -p build -config="{InheritParentConfig: true, WarningsAsErrors: '*'}" -quiet