Skip to content

Commit 0b3cf11

Browse files
arnopoedmooring
authored andcommitted
CI: rearrange github workflow
Separate the workflow as done in the libmetal library. One for the patch compliance cheks, another one for the build tests. Signed-off-by: Arnaud Pouliquen <[email protected]>
1 parent 535d0d8 commit 0b3cf11

File tree

2 files changed

+75
-58
lines changed

2 files changed

+75
-58
lines changed

.github/workflows/compliance.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2020 STMicroelectronics
3+
4+
name: open-amp lib compliance checks
5+
6+
on:
7+
pull_request:
8+
branches: [ master ]
9+
paths-ignore:
10+
- docs/**
11+
- cmake/**
12+
- scripts/**
13+
14+
jobs:
15+
checkpatch_review:
16+
name: checkpatch review
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Install python dependencies
21+
run: |
22+
pip3 install setuptools
23+
pip3 install junitparser gitlint
24+
- name: Run Compliance Tests
25+
id: compliance
26+
env:
27+
BASE_REF: ${{ github.base_ref }}
28+
run: |
29+
export PATH=$PATH:~/.local/bin
30+
export PROJECT_BASE=$PWD
31+
git config --global user.email "[email protected]"
32+
git config --global user.name "Your Name"
33+
git rebase origin/${BASE_REF}
34+
export
35+
./scripts/ci/check_compliance.py -m checkpatch -m Gitlint -m Identity -c origin/${BASE_REF}.. || true
36+
37+
- name: upload-results
38+
uses: actions/upload-artifact@master
39+
continue-on-error: True
40+
with:
41+
name: compliance.xml
42+
path: compliance.xml
43+
44+
- name: check-warns
45+
run: |
46+
if [ -s checkpatch.txt ]; then
47+
errors=$(cat checkpatch.txt)
48+
errors="${errors//'%'/'%25'}"
49+
errors="${errors//$'\n'/'%0A'}"
50+
errors="${errors//$'\r'/'%0D'}"
51+
echo "::error file=Checkpatch.txt::$errors"
52+
exit=1
53+
fi
54+
if [ -s Identity.txt ]; then
55+
errors=$(cat Identity.txt)
56+
errors="${errors//'%'/'%25'}"
57+
errors="${errors//$'\n'/'%0A'}"
58+
errors="${errors//$'\r'/'%0D'}"
59+
echo "::error file=Identity.txt::$errors"
60+
exit=1
61+
fi
62+
if [ -s Gitlint.txt ]; then
63+
errors=$(cat Gitlint.txt)
64+
errors="${errors//'%'/'%25'}"
65+
errors="${errors//$'\n'/'%0A'}"
66+
errors="${errors//$'\r'/'%0D'}"
67+
echo "::error file=Gitlint.txt::$errors"
68+
exit=1
69+
fi
70+
if [ ${exit} == 1 ]; then
71+
exit 1;
72+
fi

.github/workflows/continuous-integration.yml

+3-58
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2020 STMicroelectronics
3+
14
name: open-amp lib Continuous Integration
25

36
on:
@@ -15,64 +18,6 @@ on:
1518
- scripts/**
1619

1720
jobs:
18-
checkpatch_review:
19-
name: checkpatch review
20-
runs-on: ubuntu-latest
21-
steps:
22-
- uses: actions/checkout@v1
23-
- name: Install python dependencies
24-
run: |
25-
pip3 install setuptools
26-
pip3 install junitparser gitlint
27-
- name: Run Compliance Tests
28-
id: compliance
29-
env:
30-
BASE_REF: ${{ github.base_ref }}
31-
run: |
32-
export PATH=$PATH:~/.local/bin
33-
export PROJECT_BASE=$PWD
34-
git config --global user.email "[email protected]"
35-
git config --global user.name "Your Name"
36-
git rebase origin/${BASE_REF}
37-
export
38-
./scripts/ci/check_compliance.py -m checkpatch -m Gitlint -m Identity -c origin/${BASE_REF}.. || true
39-
40-
- name: upload-results
41-
uses: actions/upload-artifact@master
42-
continue-on-error: True
43-
with:
44-
name: compliance.xml
45-
path: compliance.xml
46-
47-
- name: check-warns
48-
run: |
49-
if [ -s checkpatch.txt ]; then
50-
errors=$(cat checkpatch.txt)
51-
errors="${errors//'%'/'%25'}"
52-
errors="${errors//$'\n'/'%0A'}"
53-
errors="${errors//$'\r'/'%0D'}"
54-
echo "::error file=Checkpatch.txt::$errors"
55-
exit=1
56-
fi
57-
if [ -s Identity.txt ]; then
58-
errors=$(cat Identity.txt)
59-
errors="${errors//'%'/'%25'}"
60-
errors="${errors//$'\n'/'%0A'}"
61-
errors="${errors//$'\r'/'%0D'}"
62-
echo "::error file=Identity.txt::$errors"
63-
exit=1
64-
fi
65-
if [ -s Gitlint.txt ]; then
66-
errors=$(cat Gitlint.txt)
67-
errors="${errors//'%'/'%25'}"
68-
errors="${errors//$'\n'/'%0A'}"
69-
errors="${errors//$'\r'/'%0D'}"
70-
echo "::error file=Gitlint.txt::$errors"
71-
exit=1
72-
fi
73-
if [ ${exit} == 1 ]; then
74-
exit 1;
75-
fi
7621
platform_builds:
7722
name: check builds on different platforms
7823
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)