From 995b1bb64bfe4a1407dcf0c5a6910dfe1d60e427 Mon Sep 17 00:00:00 2001 From: sivakesava Date: Wed, 10 Nov 2021 21:13:40 -0800 Subject: [PATCH] Dockerimage updated to ubuntu:20.04 - Ubuntu:18.04 has issues with c++17 and nlohmann_json (https://github.com/nlohmann/json/issues/3090) - Added dos2unix to fix DOS line endings to enable building in Windows - Added CodeQL analysis --- .github/workflows/codeql-analysis.yml | 70 --------------------------- .github/workflows/dockerimage.yml | 8 +++ Dockerfile | 5 +- setup.sh | 7 +-- 4 files changed, 15 insertions(+), 75 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index a50b854..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -# 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: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '24 6 * * 3' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp', 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - 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. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index 64e55b9..482a1f2 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -19,6 +19,11 @@ jobs: - name: Setup the environment run: |- bash setup.sh + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: cpp, python - name: Build and test groot run: |- @@ -29,6 +34,9 @@ jobs: cp -r ../test/TestFiles/ test/ ctest --output-on-failure --extra-verbose + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 + - name: Generate coverage file run: |- cd build diff --git a/Dockerfile b/Dockerfile index be276f3..f84c2fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 LABEL maintainer="sivakesava@cs.ucla.edu" ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - apt-get install sudo + apt-get install sudo dos2unix ENV HOME /home/groot ENV INSIDE_DOCKER="yes" @@ -18,6 +18,7 @@ USER groot WORKDIR $HOME COPY setup.sh setup.sh +RUN sudo dos2unix setup.sh RUN bash setup.sh WORKDIR $HOME/groot diff --git a/setup.sh b/setup.sh index 4c88b91..004d4f2 100644 --- a/setup.sh +++ b/setup.sh @@ -2,15 +2,16 @@ export DEBIAN_FRONTEND=noninteractive sudo apt-get update [[ "$INSIDE_DOCKER" == "yes" ]] && sudo apt-get upgrade -yq -sudo apt-get install -yq apt-utils\ +sudo DEBIAN_FRONTEND="noninteractive" apt-get install -yq apt-utils\ binutils \ cmake curl \ g++ git \ libboost-all-dev \ patch \ - sudo \ + pkg-config \ tar time \ - unzip + unzip \ + zip sudo apt-get autoremove -y --purge