246 lines
9.2 KiB
YAML
246 lines
9.2 KiB
YAML
name: Clixon CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- test-actions
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
ubuntu-build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# 1) checkout and compile natively (no test)
|
|
- name: install cligen
|
|
run: (git clone https://github.com/clicon/cligen.git && cd cligen && ./configure && make && sudo make install)
|
|
- name: run apt update
|
|
run: sudo apt update
|
|
- name: install dependencies
|
|
run: sudo apt install -y libssl-dev libnghttp2-dev
|
|
- name: configure
|
|
run: ./configure
|
|
- name: make
|
|
run: make -j10
|
|
- name: make install
|
|
run: sudo make install install-include
|
|
- name: make example
|
|
run: (cd example; make)
|
|
- name: install example
|
|
run: (cd example; sudo make install)
|
|
ubuntu-build-restconf-fcgi:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# 1) checkout and compile natively (no test)
|
|
- name: install cligen
|
|
run: (git clone https://github.com/clicon/cligen.git && cd cligen && ./configure && make && sudo make install)
|
|
- name: install dependencies
|
|
run: sudo apt install -y nginx
|
|
- name: install fcgi
|
|
run: (git clone https://github.com/FastCGI-Archives/fcgi2 && cd fcgi2 && ./autogen.sh && rm -rf .git && ./configure --prefix=/usr; make; sudo make install)
|
|
- name: configure
|
|
run: ./configure --with-restconf=fcgi
|
|
- name: make
|
|
run: make -j10
|
|
- name: make install
|
|
run: sudo make install install-include
|
|
- name: make example
|
|
run: (cd example; make)
|
|
- name: install example
|
|
run: (cd example; sudo make install)
|
|
|
|
docker-alpine-test-1:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./docker/test
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# 2) Inline of make test, but without configure
|
|
- name: in-line clone
|
|
run: git clone file://$(realpath ../..)
|
|
- name: openconfig
|
|
run: mkdir -p openconfig; cd openconfig ; git clone https://github.com/openconfig/public
|
|
- name: yangmodels1
|
|
run: mkdir -p yang/standard
|
|
- name: yangmodels2
|
|
run: (cd yang; git init;)
|
|
- name: yangmodels3
|
|
run: (cd yang; git remote add -f origin https://github.com/YangModels/yang)
|
|
- name: yangmodels4
|
|
run: (cd yang; git config core.sparseCheckout true)
|
|
- name: yangmodels5
|
|
run: (echo "standard/" >> yang/.git/info/sparse-checkout; echo "experimental/" >> yang/.git/info/sparse-checkout)
|
|
- name: yangmodels6
|
|
run: (cd yang; git pull origin main)
|
|
- name: make docker
|
|
run: sudo docker build -f Dockerfile.native -t clixon/clixon-test .
|
|
- name: start container
|
|
run: ./start.sh
|
|
- name: run test a-m,p
|
|
run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_a*.sh test_c*.sh test_d*.sh test_f*.sh test_h*.sh test_i*.sh test_j*.sh test_l*.sh test_m*.sh test_o*.sh" ./sum.sh'
|
|
|
|
docker-alpine-test-2:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./docker/test
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# 2) Inline of make test, but without configure
|
|
- name: in-line clone
|
|
run: git clone file://$(realpath ../..)
|
|
- name: openconfig
|
|
run: mkdir -p openconfig; cd openconfig ; git clone https://github.com/openconfig/public
|
|
- name: yangmodels1
|
|
run: mkdir -p yang/standard
|
|
- name: yangmodels2
|
|
run: (cd yang; git init;)
|
|
- name: yangmodels3
|
|
run: (cd yang; git remote add -f origin https://github.com/YangModels/yang)
|
|
- name: yangmodels4
|
|
run: (cd yang; git config core.sparseCheckout true)
|
|
- name: yangmodels5
|
|
run: (echo "standard/" >> yang/.git/info/sparse-checkout; echo "experimental/" >> yang/.git/info/sparse-checkout)
|
|
- name: yangmodels6
|
|
run: (cd yang; git pull origin main)
|
|
- name: make docker
|
|
run: sudo docker build -f Dockerfile.native -t clixon/clixon-test .
|
|
- name: start container
|
|
run: ./start.sh
|
|
- name: run test n-o
|
|
run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_n*.sh test_p*.sh" ./sum.sh'
|
|
|
|
docker-alpine-test-3:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./docker/test
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# 2) Inline of make test, but without configure
|
|
- name: in-line clone
|
|
run: git clone file://$(realpath ../..)
|
|
- name: openconfig
|
|
run: mkdir -p openconfig; cd openconfig ; git clone https://github.com/openconfig/public
|
|
- name: yangmodels1
|
|
run: mkdir -p yang/standard
|
|
- name: yangmodels2
|
|
run: (cd yang; git init;)
|
|
- name: yangmodels3
|
|
run: (cd yang; git remote add -f origin https://github.com/YangModels/yang)
|
|
- name: yangmodels4
|
|
run: (cd yang; git config core.sparseCheckout true)
|
|
- name: yangmodels5
|
|
run: (echo "standard/" >> yang/.git/info/sparse-checkout; echo "experimental/" >> yang/.git/info/sparse-checkout)
|
|
- name: yangmodels6
|
|
run: (cd yang; git pull origin main)
|
|
- name: make docker
|
|
run: sudo docker build -f Dockerfile.native -t clixon/clixon-test .
|
|
- name: start container
|
|
run: ./start.sh
|
|
- name: run test r-y
|
|
run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_r*.sh test_s*.sh test_t*.sh test_u*.sh test_w*.sh test_x*.sh test_y*.sh" ./sum.sh'
|
|
|
|
docker-alpine-test-fcgi-r:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./docker/test
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
# 2) Inline of make test, but without configure
|
|
- name: in-line clone
|
|
run: git clone file://$(realpath ../..)
|
|
- name: openconfig
|
|
run: mkdir -p openconfig; cd openconfig ; git clone https://github.com/openconfig/public
|
|
- name: yangmodels1
|
|
run: mkdir -p yang/standard
|
|
- name: yangmodels2
|
|
run: (cd yang; git init;)
|
|
- name: yangmodels3
|
|
run: (cd yang; git remote add -f origin https://github.com/YangModels/yang)
|
|
- name: yangmodels4
|
|
run: (cd yang; git config core.sparseCheckout true)
|
|
- name: yangmodels5
|
|
run: (echo "standard/" >> yang/.git/info/sparse-checkout; echo "experimental/" >> yang/.git/info/sparse-checkout)
|
|
- name: yangmodels6
|
|
run: (cd yang; git pull origin main)
|
|
- name: make docker fcgi
|
|
run: sudo docker build -f Dockerfile.fcgi -t clixon/clixon-test .
|
|
- name: start container
|
|
run: ./start.sh
|
|
- name: run test r-y
|
|
run: sudo docker exec -t clixon-test bash -c 'cd /usr/local/bin/test && detail=true pattern="test_r*.sh" ./sum.sh'
|
|
|
|
reset-run-number:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
run-number: ${{ steps.get-build.outputs.build-number }}
|
|
steps:
|
|
- name: Get build number and reset it
|
|
id: get-build
|
|
uses: mlilback/build-number@v1
|
|
with:
|
|
base: 0 # Update this number to reset counter
|
|
run-id: ${{ github.run_number }}
|
|
|
|
create_deb_packet:
|
|
needs: reset-run-number
|
|
#if: github.ref == 'refs/heads/master'
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
VERSION: "7.1.0"
|
|
RUN_NUMBER: ${{ needs.reset-run-number.outputs.run-number }}
|
|
permissions: write-all
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
fetch-depth: 0
|
|
- name: create dir for build
|
|
run: mkdir ${{ github.workspace }}/build
|
|
- name: Install dependencies
|
|
run: sudo apt update && sudo apt install -y build-essential flex fakeroot bison lsb-release make debhelper libnghttp2-dev libssl-dev git
|
|
- name: Clone cligen
|
|
run: git clone https://github.com/clicon/cligen.git
|
|
- name: Install cligen
|
|
run: (cd cligen; ./configure; make; sudo make install)
|
|
- name: configure
|
|
run: ./configure
|
|
- name: make
|
|
run: make
|
|
- name: install
|
|
run: sudo make install
|
|
- name: configure
|
|
run: ./configure
|
|
- name: make
|
|
run: make
|
|
- name: install
|
|
run: sudo make install DESTDIR=${{ github.workspace }}/build
|
|
- name: copy file for build deb packet dev
|
|
run: cp -r ${{ github.workspace }}/debian ${{ github.workspace }}/build
|
|
- name: add change log
|
|
run: cd ${{ github.workspace }}/build/debian && export NAME_VERSION="clixon (${{env.VERSION}}-${{env.RUN_NUMBER}})" && git --no-pager log --no-walk --encoding=utf-8 --expand-tabs=4 --pretty=format:"${NAME_VERSION} stable; urgency=medium%n%n * %w(,,2)%B%w()%n -- %an <%ae> %aD%n" > changelog && cat changelog
|
|
- name: run build packet
|
|
run: cd ${{ github.workspace }}/build && dpkg-buildpackage -us -uc
|
|
- name: show directory
|
|
run: ls -l ${{ github.workspace }}
|
|
- name: Create deb packet
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{env.VERSION}}_${{env.RUN_NUMBER}}
|
|
release_name: clixon_${{env.VERSION}}-${{env.RUN_NUMBER}}
|
|
draft: false
|
|
prerelease: false
|
|
- name: Upload artefact (clixon)
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: clixon7_${{env.VERSION}}-${{env.RUN_NUMBER}}_amd64.deb
|
|
path: ${{ github.workspace }}/clixon7_${{env.VERSION}}-${{env.RUN_NUMBER}}_amd64.deb
|