Skip to content

Commit 6f74fd1

Browse files
committed
actions REFACTOR separate devel push actions
1 parent 6eef735 commit 6f74fd1

File tree

2 files changed

+124
-60
lines changed

2 files changed

+124
-60
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
- master
1010
- devel
1111

12-
env:
13-
COVERITY_PROJECT: CESNET%2Flibyang
14-
1512
jobs:
1613
git-branch:
1714
name: Get git branch
@@ -119,30 +116,6 @@ jobs:
119116
make-prepend: "",
120117
make-target: "abi-check"
121118
}
122-
- {
123-
name: "Coverity",
124-
os: "ubuntu-latest",
125-
build-type: "Debug",
126-
cc: "clang",
127-
options: "",
128-
packager: "sudo apt-get",
129-
packages: "",
130-
snaps: "",
131-
make-prepend: "cov-build --dir cov-int",
132-
make-target: ""
133-
}
134-
- {
135-
name: "Codecov",
136-
os: "ubuntu-latest",
137-
build-type: "Debug",
138-
cc: "gcc",
139-
options: "-DENABLE_COVERAGE=ON",
140-
packager: "sudo apt-get",
141-
packages: "libcmocka-dev lcov",
142-
snaps: "",
143-
make-prepend: "",
144-
make-target: ""
145-
}
146119

147120
steps:
148121
- uses: actions/checkout@v2
@@ -171,17 +144,6 @@ jobs:
171144
sudo make install
172145
if: ${{ matrix.config.name == 'Debug, Ubuntu 18.04, gcc' }}
173146

174-
- name: Deps-coverity
175-
shell: bash
176-
working-directory: ${{ github.workspace }}
177-
run: |
178-
wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=$COVERITY_PROJECT" -O coverity-tools.tar.gz
179-
mkdir coverity-tools
180-
tar xzf coverity-tools.tar.gz --strip 1 -C coverity-tools
181-
env:
182-
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
183-
if: ${{ matrix.config.name == 'Coverity' }}
184-
185147
- name: Configure
186148
shell: bash
187149
working-directory: ${{ github.workspace }}
@@ -202,25 +164,3 @@ jobs:
202164
shell: bash
203165
working-directory: ${{ github.workspace }}/build
204166
run: ctest --output-on-failure
205-
206-
- name: Upload to Coverity.com
207-
shell: bash
208-
working-directory: ${{ github.workspace }}/build
209-
run: |
210-
tar czvf libyang.tgz cov-int
211-
curl \
212-
--form token=$TOKEN \
213-
214-
--form file=libyang.tgz \
215-
--form version="`./yanglint -v | cut -d\" \" -f2`" \
216-
--form description="libyang YANG library" \
217-
https://scan.coverity.com/builds?project=$COVERITY_PROJECT
218-
env:
219-
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
220-
if: ${{ matrix.config.name == 'Coverity' && github.event_name == 'push' && needs.git-branch.outputs.branch-name == 'devel' }}
221-
222-
- name: Upload to Codecov.io
223-
shell: bash
224-
working-directory: ${{ github.workspace }}/build
225-
run: bash <(curl -s https://codecov.io/bash)
226-
if: ${{ matrix.config.name == 'Codecov' && github.event_name == 'push' }}

.github/workflows/devel-push.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: libyang devel push
2+
on:
3+
push:
4+
branches:
5+
- devel
6+
7+
env:
8+
COVERITY_PROJECT: CESNET%2Flibyang
9+
10+
jobs:
11+
git-branch:
12+
name: Get git branch
13+
runs-on: ubuntu-18.04
14+
outputs:
15+
branch-name: ${{ steps.get-git-branch.outputs.branch-name }}
16+
steps:
17+
- id: get-git-branch
18+
run: |
19+
if ${{ github.event_name == 'push' }}
20+
then export GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
21+
else
22+
export GIT_BRANCH=${{ github.base_ref }}
23+
fi
24+
echo "::set-output name=branch-name::$GIT_BRANCH"
25+
build:
26+
name: ${{ matrix.config.name }}
27+
runs-on: ${{ matrix.config.os }}
28+
needs: git-branch
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
config:
33+
- {
34+
name: "Coverity",
35+
os: "ubuntu-latest",
36+
build-type: "Debug",
37+
cc: "clang",
38+
options: "",
39+
packager: "sudo apt-get",
40+
packages: "",
41+
snaps: "",
42+
make-prepend: "cov-build --dir cov-int",
43+
make-target: ""
44+
}
45+
- {
46+
name: "Codecov",
47+
os: "ubuntu-latest",
48+
build-type: "Debug",
49+
cc: "gcc",
50+
options: "-DENABLE_COVERAGE=ON",
51+
packager: "sudo apt-get",
52+
packages: "libcmocka-dev lcov",
53+
snaps: "",
54+
make-prepend: "",
55+
make-target: ""
56+
}
57+
58+
steps:
59+
- uses: actions/checkout@v2
60+
61+
- name: Deps-packages
62+
shell: bash
63+
run: |
64+
${{ matrix.config.packager }} update
65+
if ${{ matrix.config.packages != '' }}
66+
then ${{ matrix.config.packager }} install ${{ matrix.config.packages }}
67+
fi
68+
if ${{ matrix.config.snaps != '' }}
69+
then sudo snap install ${{ matrix.config.snaps }}
70+
fi
71+
72+
- name: Deps-coverity
73+
shell: bash
74+
working-directory: ${{ github.workspace }}
75+
run: |
76+
wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=$COVERITY_PROJECT" -O coverity-tools.tar.gz
77+
mkdir coverity-tools
78+
tar xzf coverity-tools.tar.gz --strip 1 -C coverity-tools
79+
env:
80+
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
81+
if: ${{ matrix.config.name == 'Coverity' }}
82+
83+
- name: Configure
84+
shell: bash
85+
working-directory: ${{ github.workspace }}
86+
run: |
87+
mkdir build
88+
cd build
89+
CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} ${{ matrix.config.options }} ..
90+
91+
- name: Build
92+
shell: bash
93+
working-directory: ${{ github.workspace }}/build
94+
run: |
95+
export LC_ALL=C.UTF-8
96+
export PATH=/snap/bin:${{ github.workspace }}/coverity-tools/bin:$PATH
97+
${{ matrix.config.make-prepend }} make ${{ matrix.config.make-target }}
98+
99+
- name: Test
100+
shell: bash
101+
working-directory: ${{ github.workspace }}/build
102+
run: ctest --output-on-failure
103+
104+
- name: Upload to Coverity.com
105+
shell: bash
106+
working-directory: ${{ github.workspace }}/build
107+
run: |
108+
tar czvf libyang.tgz cov-int
109+
curl \
110+
--form token=$TOKEN \
111+
112+
--form file=libyang.tgz \
113+
--form version="`./yanglint -v | cut -d\" \" -f2`" \
114+
--form description="libyang YANG library" \
115+
https://scan.coverity.com/builds?project=$COVERITY_PROJECT
116+
env:
117+
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
118+
if: ${{ matrix.config.name == 'Coverity' }}
119+
120+
- name: Upload to Codecov.io
121+
shell: bash
122+
working-directory: ${{ github.workspace }}/build
123+
run: bash <(curl -s https://codecov.io/bash)
124+
if: ${{ matrix.config.name == 'Codecov' }}

0 commit comments

Comments
 (0)