forked from Samsung/ONE
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.3 KB
/
check-format.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
name: Check code format
on:
push:
branches:
- master
- release/*
pull_request:
branches:
- master
- release/*
defaults:
run:
shell: bash
jobs:
check-format:
name: Check format
runs-on: ubuntu-24.04
if: github.repository_owner == 'Samsung'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x'
# C format: clang-format-16 (already installed)
# Python format: yapf==0.40.2
- name: Install packages
run: |
pip install yapf==0.40.2
- name: Check
run: ./nnas format
# Upload patch file if failed
- name: Store archive
uses: actions/upload-artifact@v4
if: failure()
with:
name: format-patch
path: format.patch
retention-days: 3
check-copyright:
name: Check copyright
runs-on: ubuntu-20.04
if: github.repository_owner == 'Samsung'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch all history and branch (default: 1)
# Require all history to get file creation date
fetch-depth: 0
- name: Check copyright
run: ./nnfw copyright-check