Skip to content

Commit

Permalink
Restore CodeQL and remove unused functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni-vonage committed Mar 11, 2024
1 parent 5110a2d commit 4cd84ba
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 101 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '25 20 * * 2'

permissions: read-all

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
language: [ 'c-cpp', 'go', 'java-kotlin', 'javascript-typescript', 'python' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
59 changes: 2 additions & 57 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
# MAKEFILE
#
# @author Nicola Asuni <nicola.asuni@vonage.com>
# @author Nicola Asuni
# @link https://github.com/Vonage/numkey
# ------------------------------------------------------------------------------

SHELL=/bin/bash
.SHELLFLAGS=-o pipefail -c

# Project owner
OWNER=Vonage

# Project vendor
VENDOR=${OWNER}

# Lowercase VENDOR name for Docker
LCVENDOR=$(shell echo "${VENDOR}" | tr '[:upper:]' '[:lower:]')

# CVS path (path to the parent dir containing the project)
CVSPATH=github.com/${VENDOR}

# Project name
PROJECT=numkey

Expand All @@ -34,18 +22,13 @@ CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
# Target directory
TARGETDIR=$(CURRENTDIR)target

# Docker command
ifeq ($(DOCKER),)
DOCKER=docker
endif

# --- MAKE TARGETS ---

# Display general help about this command
.PHONY: help
help:
@echo ""
@echo "NumKey Makefile."
@echo "$(PROJECT) Makefile."
@echo "The following commands are available:"
@echo ""
@echo " make c : Build and test the C version"
Expand All @@ -55,7 +38,6 @@ help:
@echo " make python : Build and test the Python version"
@echo " make java : Build and test the Java version"
@echo " make clean : Remove any build artifact"
@echo " make dbuild : Build everything inside a Docker container"
@echo " make tag : Tag the Git repository"
@echo ""

Expand Down Expand Up @@ -103,43 +85,6 @@ clean:
cd java && make clean
@mkdir -p $(TARGETDIR)

# Build everything inside a Docker container
.PHONY: dbuild
dbuild: dockerdev
@mkdir -p $(TARGETDIR)
@rm -rf $(TARGETDIR)/*
@echo 0 > $(TARGETDIR)/make.exit
CVSPATH=$(CVSPATH) VENDOR=$(LCVENDOR) PROJECT=$(PROJECT) MAKETARGET='$(MAKETARGET)' $(CURRENTDIR)/dockerbuild.sh
@exit `cat $(TARGETDIR)/make.exit`

# Build a base development Docker image
.PHONY: dockerdev
dockerdev:
$(DOCKER) build --pull --tag ${LCVENDOR}/dev_${PROJECT} --file ./resources/docker/Dockerfile.dev ./resources/docker/

# Publish Documentation in GitHub (requires writing permissions)
.PHONY: pubdocs
pubdocs:
rm -rf ./target/DOCS
rm -rf ./target/gh-pages
mkdir -p ./target/DOCS/c
cp -r ./c/target/build/doc/html/* ./target/DOCS/c/
# mkdir -p ./target/DOCS/cgo
# cp -r ./cgo/target/docs/* ./target/DOCS/cgo/
# mkdir -p ./target/DOCS/go
# cp -r ./go/target/docs/* ./target/DOCS/go/
# mkdir -p ./target/DOCS/python
# cp -r ./python/target/doc/numkey.html ./target/DOCS/python/
# cp ./resources/doc/index.html ./target/DOCS/
git clone git@github.com:Vonage/numkey.git ./target/gh-pages
cd target/gh-pages && git checkout gh-pages
mv -f ./target/gh-pages/.git ./target/DOCS/
rm -rf ./target/gh-pages
cd ./target/DOCS/ && \
git add . -A && \
git commit -m 'Update documentation' && \
git push origin gh-pages --force

# Tag the Git repository
.PHONY: tag
tag:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.24
1.5.25
4 changes: 2 additions & 2 deletions c/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MAKEFILE
#
# @author Nicola Asuni <info@tecnick.com>
# @author Nicola Asuni
# @link https://github.com/Vonage/numkey
# ------------------------------------------------------------------------------

Expand Down Expand Up @@ -58,7 +58,7 @@ PATHDEBPKG=$(CURRENTDIR)/target/DEB
.PHONY:
help:
@echo ""
@echo "$(PROJECT) Makefile."
@echo "$(PROJECT) C Makefile."
@echo "The following commands are available:"
@echo ""
@echo " make build : Build the library"
Expand Down
2 changes: 1 addition & 1 deletion c/doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PROJECT_NAME = "NumKey"
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 1.5.24
PROJECT_NUMBER = 1.5.25

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
Expand Down
10 changes: 2 additions & 8 deletions cgo/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MAKEFILE
#
# @author Nicola Asuni <info@tecnick.com>
# @author Nicola Asuni
# @link https://github.com/Vonage/numkey
# ------------------------------------------------------------------------------

Expand All @@ -13,9 +13,6 @@ OWNER=Vonage
# Project vendor
VENDOR=${OWNER}

# Lowercase VENDOR name for Docker
LCVENDOR=$(shell echo "${VENDOR}" | tr '[:upper:]' '[:lower:]')

# CVS path (path to the parent dir containing the project)
CVSPATH=github.com/${VENDOR}

Expand All @@ -28,9 +25,6 @@ VERSION=$(shell cat ../VERSION)
# Project release number (packaging build number)
RELEASE=$(shell cat ../RELEASE)

# Name of RPM or DEB package
PKGNAME=${LCVENDOR}-${PROJECT}

# Current directory
CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))

Expand Down Expand Up @@ -74,7 +68,7 @@ endif
.PHONY: help
help:
@echo ""
@echo "$(PROJECT) Makefile."
@echo "$(PROJECT) CGoMakefile."
@echo "GOPATH=$(GOPATH)"
@echo "The following commands are available:"
@echo ""
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ module github.com/Vonage/numkey

go 1.22

toolchain go1.22.1

require (
github.com/jstemmer/go-junit-report v1.0.0
github.com/rakyll/gotest v0.0.6
Expand Down
10 changes: 2 additions & 8 deletions go/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MAKEFILE
#
# @author Nicola Asuni <info@tecnick.com>
# @author Nicola Asuni
# @link https://github.com/Vonage/numkey
# ------------------------------------------------------------------------------

Expand All @@ -13,9 +13,6 @@ OWNER=Vonage
# Project vendor
VENDOR=${OWNER}

# Lowercase VENDOR name for Docker
LCVENDOR=$(shell echo "${VENDOR}" | tr '[:upper:]' '[:lower:]')

# CVS path (path to the parent dir containing the project)
CVSPATH=github.com/${VENDOR}

Expand All @@ -28,9 +25,6 @@ VERSION=$(shell cat ../VERSION)
# Project release number (packaging build number)
RELEASE=$(shell cat ../RELEASE)

# Name of RPM or DEB package
PKGNAME=${LCVENDOR}-${PROJECT}

# Current directory
CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))

Expand Down Expand Up @@ -74,7 +68,7 @@ endif
.PHONY: help
help:
@echo ""
@echo "$(PROJECT) Makefile."
@echo "$(PROJECT) Go Makefile."
@echo "GOPATH=$(GOPATH)"
@echo "The following commands are available:"
@echo ""
Expand Down
7 changes: 5 additions & 2 deletions java/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# MAKEFILE
#
# @author Nicola Asuni <nicola.asuni@vonage.com>
# @author Nicola Asuni
# @link https://github.com/Vonage/numkey
# ------------------------------------------------------------------------------

SHELL=/bin/bash
.SHELLFLAGS=-o pipefail -c

# Project name
PROJECT=numkey

# Display general help about this command
.PHONY: help
help:
@echo ""
@echo "NumKey Java Makefile."
@echo "$(PROJECT) Java Makefile."
@echo "The following commands are available:"
@echo ""
@echo " make build : Build the library"
Expand Down
7 changes: 5 additions & 2 deletions javascript/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# MAKEFILE
#
# @author Nicola Asuni <nicola.asuni@vonage.com>
# @author Nicola Asuni
# @link https://github.com/Vonage/numkey
# ------------------------------------------------------------------------------

SHELL=/bin/bash
.SHELLFLAGS=-o pipefail -c

# Project name
PROJECT=numkey

# Display general help about this command
.PHONY: help
help:
@echo ""
@echo "NumKey Javascript Makefile."
@echo "$(PROJECT) Javascript Makefile."
@echo "Requires: node-js and uglify-js."
@echo "The following commands are available:"
@echo ""
Expand Down
5 changes: 1 addition & 4 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MAKEFILE
#
# @author Nicola Asuni <info@tecnick.com>
# @author Nicola Asuni
# @link https://github.com/Vonage/numkey
# ------------------------------------------------------------------------------

Expand All @@ -16,9 +16,6 @@ VERSION=$(shell cat ../VERSION)
# Project release number (packaging build number)
RELEASE=$(shell cat ../RELEASE)

# Current directory
CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))

# --- MAKE TARGETS ---

# Display general help about this command
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def run(self):

setup(
name="numkey",
version="1.5.24.1",
version="1.5.25.1",
keywords=("numkey E.164 shortcode lvn did encoding"),
description="NumKey Bindings for Python",
long_description=read("../README.md"),
Expand Down
14 changes: 0 additions & 14 deletions resources/doc/index.html

This file was deleted.

1 change: 0 additions & 1 deletion resources/docker/Dockerfile.dev

This file was deleted.

0 comments on commit 4cd84ba

Please sign in to comment.