-
Notifications
You must be signed in to change notification settings - Fork 231
74 lines (61 loc) · 2.03 KB
/
ci.yml
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
71
72
73
74
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
test_gmp:
strategy:
matrix:
include:
- os: ubuntu-latest
bazel_config: linux
- os: macos-latest
bazel_config: macos_x86_64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Bazel
uses: bazelbuild/setup-bazelisk@v2
- name: Setup Python and Install numpy
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install numpy
run: python -m pip install numpy
- name: Build
run: bazel build -c fastbuild --config ${{ matrix.bazel_config }} --config gmp_backend //...
- name: Test
run: bazel test -c fastbuild --config ${{ matrix.bazel_config }} --config gmp_backend --test_tag_filters -benchmark,-manual,-cuda,-rust //...
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git fetch --all
- name: Setup Python for cpplint
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install cpplint
run: pip install cpplint
- name: Run cpplint
if: github.event_name == 'pull_request'
run: git diff --name-only HEAD origin/${{ github.base_ref }} | xargs cpplint --filter=-legal/copyright,-whitespace/line_length,-build/namespaces,-runtime/references
- name: Run clang-format lint
uses: DoozyX/[email protected]
with:
source: "."
exclude: "./lib"
extensions: "h,cc"
clangFormatVersion: 15
inplace: True