diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml new file mode 100644 index 00000000000..649f1c52925 --- /dev/null +++ b/.github/workflows/alpine.yml @@ -0,0 +1,149 @@ +--- +name: alpine docker image +on: + push: + branches: + - master + tags: + - '5.6.*' + - '5.7.*' + +# This environments for backward compatability with build script for DockerHub +env: + IMAGE_NAME: kamailio-ci + SOURCE_BRANCH: ${{ github.ref_name }} + +jobs: + x86_64: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Compile Kamailio source + run: | + git submodule init + git submodule update + sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/Dockerfile* + #sed -i -e 's/3.12/3.17/' ${{ github.workspace }}/pkg/docker/alpine/hooks/pre_build + cd pkg/docker/alpine + ./hooks/pre_build || true + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=pep440,pattern={{version}} + type=pep440,pattern={{major}}.{{minor}} + type=pep440,pattern={{major}} + type=ref,event=branch + flavor: | + suffix= + + - name: Docker meta "-alpine" + id: meta-alpine + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=pep440,pattern={{version}} + type=pep440,pattern={{major}}.{{minor}} + type=pep440,pattern={{major}} + type=ref,event=branch + flavor: | + suffix=-alpine + + - name: Docker meta "-debug" + id: meta-debug + uses: docker/metadata-action@v4 + with: + # list of Docker images to use as base name for tags + images: | + ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=pep440,pattern={{version}} + type=pep440,pattern={{major}}.{{minor}} + type=pep440,pattern={{major}} + type=ref,event=branch + flavor: | + suffix=-debug + + - name: Login to GitHub Container Registry + if: ${{ github.event_name != 'pull_request' }} + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push minimal + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: pkg/docker/alpine/Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - name: temporal workarround + run: | + sudo chown -R ${USER}:${USER} ${{ github.workspace }}/pkg/docker/alpine + cd pkg/docker/alpine + mv kamailio_min.tar.gz.without_os_files kamailio_min-without_os_files.tar.gz + ls -l . + + - name: Build and push with apk + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: pkg/docker/alpine/Dockerfile.alpine + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-alpine.outputs.tags }} + labels: ${{ steps.meta-alpine.outputs.labels }} + + - name: Prepare local repo + run: | + docker network create kamailio-build + docker run \ + --detach \ + --network kamailio-build \ + --name local-repo \ + --hostname local-repo \ + --rm=true \ + --volume=${{ github.workspace }}/pkg/docker/alpine/apk_files:/usr/share/nginx/html:ro \ + nginx + LOCAL_REPO_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' local-repo) + sed -i -e "s/local-repo/${LOCAL_REPO_IP}/" pkg/docker/alpine/Dockerfile.debug + + - name: Prepare builder with local repo + id: local-repo + uses: docker/setup-buildx-action@v2 + with: + driver-opts: | + network=kamailio-build + + - name: Build and push with debug + uses: docker/build-push-action@v4 + with: + context: pkg/docker/alpine + file: pkg/docker/alpine/Dockerfile.debug + builder: ${{ steps.local-repo.outputs.name }} + push: ${{ github.event_name == 'pull_request' }} + tags: ${{ steps.meta-debug.outputs.tags }} + labels: ${{ steps.meta-debug.outputs.labels }} + + - name: Delete local repo + run: | + docker buildx stop ${{ steps.local-repo.outputs.name }} + docker buildx rm ${{ steps.local-repo.outputs.name }} + docker stop local-repo + docker network rm kamailio-build diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml deleted file mode 100644 index 948ab18b888..00000000000 --- a/.github/workflows/cifuzz.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: CIFuzz -on: [pull_request] -jobs: - Fuzzing: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'kamailio' - dry-run: false - language: c - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'kamailio' - fuzz-seconds: 600 - dry-run: false - language: c - - name: Upload Crash - uses: actions/upload-artifact@v1 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index bc0eebfbe40..00000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: [ "master", "3.1", "3.2", "3.3", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6" ] - pull_request: - branches: [ "master" ] - schedule: - - cron: "35 19 * * 3" - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ javascript, cpp, python ] - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install Packages (cpp) - if: ${{ matrix.language == 'cpp' }} - run: | - sudo apt-get update - sudo apt-get install --yes bison default-libmysqlclient-dev flex libcurl4-openssl-dev libjansson-dev libhiredis-dev libevent-dev liblua5.1-0-dev libpcre3-dev libncurses5-dev libpq-dev libreadline-dev libssl-dev libunistring-dev libxml2-dev pkg-config python3 python3-dev uuid-dev zlib1g-dev - - - name: Configure (cpp) - if: ${{ matrix.language == 'cpp' }} - run: make include_modules='app_lua app_python3 cnxcc db_mysql db_postgres db_redis dialplan http_client jansson lcr ndb_redis presence presence_xml presence_dialoginfo pua pua_dialoginfo topos_redis uuid websocket xmlops' cfg - - - name: After Prepare (cpp) - if: ${{ matrix.language == 'cpp' }} - run: export PKG_CONFIG_PATH=$RUNNER_TEMP/usr/lib/pkgconfig:$PKG_CONFIG_PATH && echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - queries: +security-and-quality - - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - if: ${{ matrix.language == 'javascript' || matrix.language == 'python' }} - - - name: Build cpp - if: ${{ matrix.language == 'cpp' }} - run: make all - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 71b9d6c5480..00000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -name: build -'on': - push: - branches: - - master - - '5.6' - - '5.5' - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: -permissions: - contents: read # to fetch code (actions/checkout) -jobs: - build: - runs-on: ubuntu-latest - container: - image: ghcr.io/kamailio/pkg-kamailio-docker:${{ github.ref_name }}-${{ matrix.distribution }} - volumes: - - ${{ github.workspace }}:/code - env: - DIST: ${{ matrix.distribution }} - CC: ${{ matrix.compilier }} - strategy: - matrix: - include: - - distribution: bullseye - compilier: gcc - - distribution: bullseye - compilier: clang - - distribution: sid - compilier: gcc - - distribution: sid - compilier: clang - steps: - - uses: actions/checkout@v2 - - uses: ammaraskar/gcc-problem-matcher@0.2.0 - - name: build - run: | - cd /code - ./test/travis/build_travis.sh - shell: bash diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index e2f6416ce42..00000000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: checks_pr -'on': - pull_request: - branches: - - master - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: -permissions: - contents: read # to fetch code (actions/checkout) -jobs: - build: - runs-on: ubuntu-latest - container: - image: kamailio/pkg-kamailio-docker:master-${{ matrix.distribution }} - volumes: - - ${{ github.workspace }}:/code - env: - DIST: ${{ matrix.distribution }} - CC: ${{ matrix.compilier }} - strategy: - matrix: - include: - - distribution: bullseye - compilier: gcc - - distribution: bullseye - compilier: clang - steps: - - uses: actions/checkout@v2 - - uses: ammaraskar/gcc-problem-matcher@0.1 - - name: build - run: | - cd /code - ./test/travis/build_travis.sh - shell: bash