actions REFACTOR separate devel push actions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b6dc78f..bdfec88 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,9 +9,6 @@
- master
- devel
-env:
- COVERITY_PROJECT: CESNET%2Flibyang
-
jobs:
git-branch:
name: Get git branch
@@ -119,30 +116,6 @@
make-prepend: "",
make-target: "abi-check"
}
- - {
- name: "Coverity",
- os: "ubuntu-latest",
- build-type: "Debug",
- cc: "clang",
- options: "",
- packager: "sudo apt-get",
- packages: "",
- snaps: "",
- make-prepend: "cov-build --dir cov-int",
- make-target: ""
- }
- - {
- name: "Codecov",
- os: "ubuntu-latest",
- build-type: "Debug",
- cc: "gcc",
- options: "-DENABLE_COVERAGE=ON",
- packager: "sudo apt-get",
- packages: "libcmocka-dev lcov",
- snaps: "",
- make-prepend: "",
- make-target: ""
- }
steps:
- uses: actions/checkout@v2
@@ -171,17 +144,6 @@
sudo make install
if: ${{ matrix.config.name == 'Debug, Ubuntu 18.04, gcc' }}
- - name: Deps-coverity
- shell: bash
- working-directory: ${{ github.workspace }}
- run: |
- wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=$COVERITY_PROJECT" -O coverity-tools.tar.gz
- mkdir coverity-tools
- tar xzf coverity-tools.tar.gz --strip 1 -C coverity-tools
- env:
- TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
- if: ${{ matrix.config.name == 'Coverity' }}
-
- name: Configure
shell: bash
working-directory: ${{ github.workspace }}
@@ -202,25 +164,3 @@
shell: bash
working-directory: ${{ github.workspace }}/build
run: ctest --output-on-failure
-
- - name: Upload to Coverity.com
- shell: bash
- working-directory: ${{ github.workspace }}/build
- run: |
- tar czvf libyang.tgz cov-int
- curl \
- --form token=$TOKEN \
- --form email=mvasko@cesnet.cz \
- --form file=libyang.tgz \
- --form version="`./yanglint -v | cut -d\" \" -f2`" \
- --form description="libyang YANG library" \
- https://scan.coverity.com/builds?project=$COVERITY_PROJECT
- env:
- TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
- if: ${{ matrix.config.name == 'Coverity' && github.event_name == 'push' && needs.git-branch.outputs.branch-name == 'devel' }}
-
- - name: Upload to Codecov.io
- shell: bash
- working-directory: ${{ github.workspace }}/build
- run: bash <(curl -s https://codecov.io/bash)
- if: ${{ matrix.config.name == 'Codecov' && github.event_name == 'push' }}
diff --git a/.github/workflows/devel-push.yml b/.github/workflows/devel-push.yml
new file mode 100644
index 0000000..80f360f
--- /dev/null
+++ b/.github/workflows/devel-push.yml
@@ -0,0 +1,124 @@
+name: libyang devel push
+on:
+ push:
+ branches:
+ - devel
+
+env:
+ COVERITY_PROJECT: CESNET%2Flibyang
+
+jobs:
+ git-branch:
+ name: Get git branch
+ runs-on: ubuntu-18.04
+ outputs:
+ branch-name: ${{ steps.get-git-branch.outputs.branch-name }}
+ steps:
+ - id: get-git-branch
+ run: |
+ if ${{ github.event_name == 'push' }}
+ then export GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
+ else
+ export GIT_BRANCH=${{ github.base_ref }}
+ fi
+ echo "::set-output name=branch-name::$GIT_BRANCH"
+ build:
+ name: ${{ matrix.config.name }}
+ runs-on: ${{ matrix.config.os }}
+ needs: git-branch
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ - {
+ name: "Coverity",
+ os: "ubuntu-latest",
+ build-type: "Debug",
+ cc: "clang",
+ options: "",
+ packager: "sudo apt-get",
+ packages: "",
+ snaps: "",
+ make-prepend: "cov-build --dir cov-int",
+ make-target: ""
+ }
+ - {
+ name: "Codecov",
+ os: "ubuntu-latest",
+ build-type: "Debug",
+ cc: "gcc",
+ options: "-DENABLE_COVERAGE=ON",
+ packager: "sudo apt-get",
+ packages: "libcmocka-dev lcov",
+ snaps: "",
+ make-prepend: "",
+ make-target: ""
+ }
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Deps-packages
+ shell: bash
+ run: |
+ ${{ matrix.config.packager }} update
+ if ${{ matrix.config.packages != '' }}
+ then ${{ matrix.config.packager }} install ${{ matrix.config.packages }}
+ fi
+ if ${{ matrix.config.snaps != '' }}
+ then sudo snap install ${{ matrix.config.snaps }}
+ fi
+
+ - name: Deps-coverity
+ shell: bash
+ working-directory: ${{ github.workspace }}
+ run: |
+ wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=$COVERITY_PROJECT" -O coverity-tools.tar.gz
+ mkdir coverity-tools
+ tar xzf coverity-tools.tar.gz --strip 1 -C coverity-tools
+ env:
+ TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
+ if: ${{ matrix.config.name == 'Coverity' }}
+
+ - name: Configure
+ shell: bash
+ working-directory: ${{ github.workspace }}
+ run: |
+ mkdir build
+ cd build
+ CC=${{ matrix.config.cc }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }} ${{ matrix.config.options }} ..
+
+ - name: Build
+ shell: bash
+ working-directory: ${{ github.workspace }}/build
+ run: |
+ export LC_ALL=C.UTF-8
+ export PATH=/snap/bin:${{ github.workspace }}/coverity-tools/bin:$PATH
+ ${{ matrix.config.make-prepend }} make ${{ matrix.config.make-target }}
+
+ - name: Test
+ shell: bash
+ working-directory: ${{ github.workspace }}/build
+ run: ctest --output-on-failure
+
+ - name: Upload to Coverity.com
+ shell: bash
+ working-directory: ${{ github.workspace }}/build
+ run: |
+ tar czvf libyang.tgz cov-int
+ curl \
+ --form token=$TOKEN \
+ --form email=mvasko@cesnet.cz \
+ --form file=libyang.tgz \
+ --form version="`./yanglint -v | cut -d\" \" -f2`" \
+ --form description="libyang YANG library" \
+ https://scan.coverity.com/builds?project=$COVERITY_PROJECT
+ env:
+ TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
+ if: ${{ matrix.config.name == 'Coverity' }}
+
+ - name: Upload to Codecov.io
+ shell: bash
+ working-directory: ${{ github.workspace }}/build
+ run: bash <(curl -s https://codecov.io/bash)
+ if: ${{ matrix.config.name == 'Codecov' }}