forked from ProjectQ-Framework/ProjectQ
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (50 loc) · 1.48 KB
/
format.yml
File metadata and controls
60 lines (50 loc) · 1.48 KB
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
name: Format
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- stable
- "v*"
jobs:
pre-commit:
name: Format and static analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get history and tags for SCM versioning to work
if: ${{ !env.ACT }}
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-python@v2
- name: Install pre-commit
run: python3 -m pip install --upgrade pre-commit 'virtualenv!=20.11'
- name: Cache pre-commit hooks
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
restore-keys: pre-commit-
- name: Run pre-commit
run: |
# Slow hooks are marked with manual - slow is okay here, run them too
pre-commit run --hook-stage manual --all-files
clang-tidy:
name: Clang-Tidy
runs-on: ubuntu-latest
container: silkeh/clang:10
env:
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v2
- name: Prepare env
run: >
apt-get update && apt-get install -y python3-dev python3-pip python3-setuptools python3-wheel
--no-install-recommends
- name: Upgrade pybind11
run: python3 -m pip install --upgrade pybind11 --prefer-binary
- name: Run Clang-Tidy
run: python3 setup.py clang_tidy --warning-as-errors